Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
logging/logging.h@77:f6717e4eccc4, 2015-03-03 (annotated)
- Committer:
- xinlei
- Date:
- Tue Mar 03 14:10:09 2015 +0000
- Revision:
- 77:f6717e4eccc4
- Parent:
- 75:d4535238db18
Working device push, DNS caching, change logging level when running and more.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
xinlei | 72:c5709ae7b193 | 1 | #ifndef LOGGING_H |
xinlei | 72:c5709ae7b193 | 2 | #define LOGGING_H |
xinlei | 72:c5709ae7b193 | 3 | |
xinlei | 72:c5709ae7b193 | 4 | /* Enumeration of logging levels. |
xinlei | 72:c5709ae7b193 | 5 | Logging levels below have higher severity than the above levels. |
xinlei | 72:c5709ae7b193 | 6 | */ |
xinlei | 72:c5709ae7b193 | 7 | enum aLogLevel{ |
xinlei | 77:f6717e4eccc4 | 8 | A_DEBUG=1, |
xinlei | 77:f6717e4eccc4 | 9 | A_INFO, |
xinlei | 77:f6717e4eccc4 | 10 | A_WARNING, |
xinlei | 77:f6717e4eccc4 | 11 | A_ERROR, |
xinlei | 77:f6717e4eccc4 | 12 | A_CRITICAL, |
xinlei | 77:f6717e4eccc4 | 13 | A_NONE // No logging |
xinlei | 72:c5709ae7b193 | 14 | }; |
xinlei | 72:c5709ae7b193 | 15 | |
xinlei | 73:313975bfec96 | 16 | /* All logging functions. |
xinlei | 73:313975bfec96 | 17 | * Function name indicates the corresponding logging level. |
xinlei | 73:313975bfec96 | 18 | * First argument is a format string, remaining arguments |
xinlei | 73:313975bfec96 | 19 | * must correspond to the given format, like in printf. |
xinlei | 73:313975bfec96 | 20 | */ |
xinlei | 72:c5709ae7b193 | 21 | int aDebug(const char *fmt, ...); |
xinlei | 72:c5709ae7b193 | 22 | int aInfo(const char *fmt, ...); |
xinlei | 72:c5709ae7b193 | 23 | int aWarning(const char *fmt, ...); |
xinlei | 75:d4535238db18 | 24 | int aError(const char *fmt, ...); |
xinlei | 75:d4535238db18 | 25 | int aCritical(const char *fmt, ...); |
xinlei | 72:c5709ae7b193 | 26 | |
xinlei | 72:c5709ae7b193 | 27 | aLogLevel getLevel(); |
xinlei | 72:c5709ae7b193 | 28 | void setLevel(aLogLevel lvl); |
xinlei | 77:f6717e4eccc4 | 29 | void higherOneLevel(); // Set log level one severity higher (terser), does nothing when already highest |
xinlei | 77:f6717e4eccc4 | 30 | void lowerOneLevel(); // Set log level one severity lower (chattier), does nothing when already lowerest |
xinlei | 72:c5709ae7b193 | 31 | #endif /* LOGGING_H */ |