log4Esp is a light-wight logging library for ESP8266.
Namespace¶
-
namespace
log4Esp
¶ -
class
Appender
¶ - #include <Appender.h>
Appenders represent a logging destination.
Subclassed by log4Esp::RollingFileAppender, log4Esp::SerialAppender
-
class
RollingFileAppender
: public log4Esp::Appender¶ - #include <RollingFileAppender.h>
RollingFileAppender logs data to a rolling file.
-
class
SerialAppender
: public log4Esp::Appender¶ - #include <SerialAppender.h>
SerialAppender logs data to Serial.
-
class
Classes¶
-
class
Logger
¶ Public Functions
-
Logger
(const char *name = "default", bool addDefaultSerialAppender = true)¶ Logger represents the central interface to all log operations.
- Parameters
name
: labels internal Logger nameaddDefaultSerialAppender
: adds a SerialAppender optional
-
template <class T, typename... Args>
voidfatal
(T msg, Args... args)¶ Print a log entry in [fatal] mode to all associated Appenders.
- Parameters
msg
: log entry with optional format instructions and placeholdersargs
: arguments replacing placeholders
-
template <class T, typename... Args>
voiderror
(T msg, Args... args)¶ Print a log entry in [error] mode to all associated Appenders.
- Parameters
msg
: log entry with optional format instructions and placeholdersargs
: arguments replacing placeholders
-
template <class T, typename... Args>
voidwarning
(T msg, Args... args)¶ Print a log entry in [warning] mode to all associated Appenders.
- Parameters
msg
: log entry with optional format instructions and placeholdersargs
: arguments replacing placeholders
-
template <class T, typename... Args>
voidverbose
(T msg, Args... args)¶ Print a log entry in [verbose] mode to all associated Appenders.
- Parameters
msg
: log entry with optional format instructions and placeholdersargs
: arguments replacing placeholders
-
template <class T, typename... Args>
voidtrace
(T msg, Args... args)¶ Print a log entry in [trace] mode to all associated Appenders.
- Parameters
msg
: log entry with optional format instructions and placeholdersargs
: arguments replacing placeholders
-
void
addFormatterToAll
(Appender::FormatterFunction formatterFunction)¶ - Parameters
add
: same FormatterFunction to all associated Appenders
-
-
class
Appender
Appenders represent a logging destination.
Subclassed by log4Esp::RollingFileAppender, log4Esp::SerialAppender
Public Functions
-
virtual Print &
getOutput
() = 0¶ - Return
- output reference
-
void
setFormatter
(FormatterFunction formatterFunction)¶ - Parameters
set
: Formatter
-
void
addFilter
(FilterFunction filterFunction)¶ - Parameters
add
: a Filter
-
void
setLevel
(Level level)¶ - Parameters
set
: a certain logging Level
-
void
print
(Level level, const char *msg, va_list *args)¶ Print a log entry.
- Parameters
level
: represents logging level of entrymsg
: log entry with optional format instructions and placeholdersargs
: arguments replacing placeholders
-
virtual Print &