added max-age and content-format

Fork of mbedConnectorInterface by Doug Anson

Revision:
0:b438482ebbfc
Child:
2:853f9ecc12df
diff -r 000000000000 -r b438482ebbfc api/Logger.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/api/Logger.cpp	Tue Jan 27 22:23:51 2015 +0000
@@ -0,0 +1,54 @@
+/**
+ * @file    Logger.cpp
+ * @brief   mbed CoAP Endpoint logging class
+ * @author  Doug Anson/Chris Paola
+ * @version 1.0
+ * @see     
+ *
+ * Copyright (c) 2014
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+ #include "Logger.h"
+ 
+ // Constructor
+ Logger::Logger(const BufferedSerial *pc) {
+     this->m_pc = (BufferedSerial *)pc;
+ }
+ 
+ // Copy Constructor
+ Logger::Logger(const Logger &logger) {
+     this->m_pc = logger.m_pc;
+ }
+ 
+ // Destructor
+ Logger::~Logger() {
+ }
+ 
+ // Log output
+ void Logger::log(const char *format,...) {
+    va_list args;
+    va_start(args,format);
+    if (this->m_pc != NULL) {
+        //this->m_pc->printf(format,args);
+        //this->m_pc->printf("\r\n");
+        std::printf(format,args);
+        std::printf("\r\n");
+    }
+    else {
+        std::printf(format,args);
+        std::printf("\r\n");
+    }
+    va_end(args);
+ }
\ No newline at end of file