My Project
|
Logging framework. More...
Classes | |
class | Handler |
Logger handler used to process log messages. More... | |
class | Logger |
Logger instance used to make log messages. More... | |
struct | Message |
Log message text with timestamp and logger attributes. More... | |
class | PrintHandler |
Basic log handler for writing messages to any object supporting the Print interface. More... | |
Enumerations | |
enum | Level : int8_t { OFF = -1, EMERG = 0, ALERT, CRIT, ERR, WARNING, NOTICE, INFO, DEBUG, TRACE, ALL } |
Severity level of log messages. More... | |
enum | Facility : uint8_t { KERN = 0, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, NTP, SECURITY, CONSOLE, CRON2, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7 } |
Facility type of the process logging a message. More... | |
Functions | |
char | format_level_char (Level level) |
Format a log level as a single character. More... | |
const __FlashStringHelper * | format_level_lowercase (Level level) |
Format a log level as a lowercase string. More... | |
const __FlashStringHelper * | format_level_uppercase (Level level) |
Format a log level as an uppercase string. More... | |
std::string | format_timestamp_ms (uint64_t timestamp_ms, unsigned int days_width=1) |
Format a system uptime timestamp as a string. More... | |
std::vector< Level > | levels () |
Get all log levels. More... | |
std::vector< std::string > | levels_lowercase () |
Get all log levels as lowercase strings. More... | |
std::vector< std::string > | levels_uppercase () |
Get all log levels as uppercase strings. More... | |
bool | parse_level_lowercase (const std::string &name, Level &level) |
Parse a lowercase string to a log level. More... | |
bool | parse_level_uppercase (const std::string &name, Level &level) |
Parse an uppercase string to a log level. More... | |
Variables | |
static constexpr bool | thread_safe = false |
Thread-safe status of the library. More... | |
Logging framework.
Provides a framework for handling log messages. This library is for single threaded applications and cannot be used from an interrupt context.
enum uuid::log::Facility : uint8_t |
Facility type of the process logging a message.
enum uuid::log::Level : int8_t |
Severity level of log messages.
char uuid::log::format_level_char | ( | Level | level | ) |
Format a log level as a single character.
Level::EMERG is represented as 'P' because it conflicts with Level::ERR and it used to be the "panic" level.
[in] | level | Log level. |
Definition at line 25 of file format_level_char.cpp.
const __FlashStringHelper * uuid::log::format_level_lowercase | ( | Level | level | ) |
Format a log level as a lowercase string.
[in] | level | Log level. |
Definition at line 61 of file format_level_lowercase.cpp.
const __FlashStringHelper * uuid::log::format_level_uppercase | ( | Level | level | ) |
Format a log level as an uppercase string.
[in] | level | Log level. |
Definition at line 61 of file format_level_uppercase.cpp.
std::string uuid::log::format_timestamp_ms | ( | uint64_t | timestamp_ms, |
unsigned int | days_width = 1 |
||
) |
Format a system uptime timestamp as a string.
Using the format "d+HH:mm:ss.SSS" with leading zeros for the days.
[in] | timestamp_ms | System uptime in milliseconds, see uuid::get_uptime_ms(). |
[in] | days_width | Leading zeros for the days part of the output. |
Definition at line 31 of file format_timestamp_ms.cpp.
std::vector< Level > uuid::log::levels | ( | ) |
Get all log levels.
Definition at line 27 of file levels.cpp.
std::vector< std::string > uuid::log::levels_lowercase | ( | ) |
Get all log levels as lowercase strings.
Definition at line 29 of file levels_lowercase.cpp.
std::vector< std::string > uuid::log::levels_uppercase | ( | ) |
Get all log levels as uppercase strings.
Definition at line 29 of file levels_uppercase.cpp.
bool uuid::log::parse_level_lowercase | ( | const std::string & | name, |
Level & | level | ||
) |
Parse a lowercase string to a log level.
[in] | name | Lowercase name of the log level. |
[out] | level | Log level. |
Definition at line 29 of file parse_level_lowercase.cpp.
bool uuid::log::parse_level_uppercase | ( | const std::string & | name, |
Level & | level | ||
) |
Parse an uppercase string to a log level.
[in] | name | Uppercase name of the log level. |
[out] | level | Log level. |
Definition at line 29 of file parse_level_uppercase.cpp.