Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Logger.h
00001 /** 00002 * @file Logger.h 00003 * @brief mbed CoAP Endpoint logging class 00004 * @author Doug Anson/Chris Paola 00005 * @version 1.0 00006 * @see 00007 * 00008 * Copyright (c) 2014 00009 * 00010 * Licensed under the Apache License, Version 2.0 (the "License"); 00011 * you may not use this file except in compliance with the License. 00012 * You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, software 00017 * distributed under the License is distributed on an "AS IS" BASIS, 00018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 * See the License for the specific language governing permissions and 00020 * limitations under the License. 00021 */ 00022 00023 #ifndef __LOGGER_H__ 00024 #define __LOGGER_H__ 00025 00026 // mbed API 00027 #include "mbed.h" 00028 00029 // Support for std args 00030 #include <stdarg.h> 00031 00032 // Configuration 00033 #include "mbed-connector-interface/mbedConnectorInterface.h" 00034 00035 // logging macro 00036 #define log(x, ...) logIt(x"\r\n",##__VA_ARGS__) 00037 00038 /** Logger class 00039 */ 00040 class Logger 00041 { 00042 public: 00043 /** 00044 Default constructor 00045 @param pc input BufferedSerial instance for debugging (if NULL, no debugging output will occur in the library) 00046 */ 00047 Logger(const Serial *pc); 00048 00049 /** 00050 Copy constructor 00051 @param logger input Logger instance to deep copy 00052 */ 00053 Logger(const Logger &logger); 00054 00055 /** 00056 Destructor 00057 */ 00058 virtual ~Logger(); 00059 00060 /** 00061 Log output to the given serial console 00062 @param format input format for the logging 00063 @param ... input (variable arguments to display) 00064 */ 00065 void logIt(const char *format, ...); 00066 protected: 00067 00068 private: 00069 Serial *m_pc; 00070 }; 00071 00072 #endif // __LOGGER_H__ 00073
Generated on Wed Jul 13 2022 21:59:32 by
1.7.2