Serial output logger based on the LoggerInterface
Fork of LogIt by
loggers/serial_logger.h@6:17bc740828b8, 2016-12-15 (annotated)
- Committer:
- Nico De Witte
- Date:
- Thu Dec 15 19:29:05 2016 +0100
- Revision:
- 6:17bc740828b8
- Parent:
- 4:9c5143891c8a
Make logger pointer in logable protected instead of public.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nico De Witte |
4:9c5143891c8a | 1 | #pragma once |
Nico De Witte |
4:9c5143891c8a | 2 | |
Nico De Witte |
4:9c5143891c8a | 3 | #include "LoggerInterface.h" |
Nico De Witte |
4:9c5143891c8a | 4 | #include "mbed.h" |
Nico De Witte |
4:9c5143891c8a | 5 | |
Nico De Witte |
4:9c5143891c8a | 6 | namespace LogIt { |
Nico De Witte |
4:9c5143891c8a | 7 | |
Nico De Witte |
4:9c5143891c8a | 8 | class SerialLogger : public Log::LoggerInterface |
Nico De Witte |
4:9c5143891c8a | 9 | { |
Nico De Witte |
4:9c5143891c8a | 10 | public: |
Nico De Witte |
4:9c5143891c8a | 11 | SerialLogger(Serial* serial); |
Nico De Witte |
4:9c5143891c8a | 12 | void emergency(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 13 | void alert(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 14 | void critical(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 15 | void error(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 16 | void warning(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 17 | void notice(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 18 | void info(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 19 | void debug(const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 20 | void log(Level level, const char * message, ...); |
Nico De Witte |
4:9c5143891c8a | 21 | |
Nico De Witte |
4:9c5143891c8a | 22 | void setLevel(Level level); |
Nico De Witte |
4:9c5143891c8a | 23 | |
Nico De Witte |
4:9c5143891c8a | 24 | protected: |
Nico De Witte |
4:9c5143891c8a | 25 | Serial* serial; |
Nico De Witte |
4:9c5143891c8a | 26 | Level level; // minimum level to log |
Nico De Witte |
4:9c5143891c8a | 27 | |
Nico De Witte |
4:9c5143891c8a | 28 | private: |
Nico De Witte |
4:9c5143891c8a | 29 | void log(Level level, const char * message, va_list args); |
Nico De Witte |
4:9c5143891c8a | 30 | }; |
Nico De Witte |
4:9c5143891c8a | 31 | |
Nico De Witte |
4:9c5143891c8a | 32 | }; |