Lightweight structured logging class for embedded applications.
More...
#include <cstdio>
#include <ctime>
#include <string>
#include "storage/StorageManager.h"
Go to the source code of this file.
|
class | Logger |
| Basic timestamped logger with optional SD file logging. More...
|
|
- Author
- Ian Archbell
Part of the PicoFramework application framework. Logs messages with timestamps and severity levels (INFO, WARN, ERROR). Optionally supports logging to an SD card via FatFsStorageManager.
Usage example:
@ LOG_INFO
Informational messages.
static void info(const char *msg)
Log an informational message.
static void error(const char *msg)
Log an error message.
static void setMinLogLevel(LogLevel level)
Set the minimum log level (filters lower levels).
static void enableFileLogging(const std::string &path)
Enable writing logs to SD card via a storage manager.
static void warn(const char *msg)
Log a warning message.
- Version
- 0.2
- Date
- 2025-03-31
- License:\n MIT License
- Copyright
- Copyright (c) 2025, Ian Archbell
Definition in file Logger.h.
◆ LogLevel
Enumerator |
---|
LOG_INFO | Informational messages.
|
LOG_WARN | Warnings (non-fatal)
|
LOG_ERROR | Errors (potentially requiring user action)
|
Definition at line 37 of file Logger.h.
37 {
41 };
@ LOG_ERROR
Errors (potentially requiring user action)
@ LOG_WARN
Warnings (non-fatal)