|
TinyWifiDongle 0.1.0
Header-only USB WiFi dongle for Arduino
|
Printf-style logger with log levels; use the global TWD_LOGGER object. More...
#include <Logger.h>
Public Types | |
| enum class | LogLevel : uint8_t { Debug , Info , Warning , Error } |
| Severity of a log line; lines below the level set with begin() are discarded. More... | |
Public Member Functions | |
| void | begin (Print &out, LogLevel level=LogLevel::Info) |
| Lines of level and above are written to out (e.g. Serial); call before starting the dongle. | |
| void | end () |
| Stop logging. | |
| void | flush () |
| Waits until the output has sent what was written (e.g. before a restart). | |
| void | setLevel (LogLevel level) |
| Lowest level that is written. | |
| LogLevel | level () const |
| bool | enabled (LogLevel level=LogLevel::Info) const |
| True if lines of level are written somewhere. | |
| void | log (LogLevel level, const char *fmt,...) |
| Formats and writes one line of level; does nothing if that level is not enabled. | |
| void | debug (const char *fmt,...) |
| void | info (const char *fmt,...) |
| void | warning (const char *fmt,...) |
| void | error (const char *fmt,...) |
| void | vlog (LogLevel level, const char *fmt, va_list ap) |
| va_list variant of log(). | |
Printf-style logger with log levels; use the global TWD_LOGGER object.
Discards everything until the sketch calls begin(), so components can always log without checking whether logging is wanted. Each line is handed to the output with a single write() call, as [dongle] <level letter> <text>.
|
strong |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |