Boboter
Loading...
Searching...
No Matches
Logger Class Reference

#include <logger.h>

Classes

struct  log_item

Public Member Functions

void custom_log (esp_log_level_t level, const char *tag, const char *format,...) const __attribute__((format(printf
 Either directly invokes render_to_console (real mode) or sends to the queue (queue mode).
void void print_linefeed () const
 Prints a \n in the currently selected mode.
void switch_to_queue_logging (QueueHandle_t log_queue_handle)
 Switches the logger's mode to queue logging.
void process_log_queue () const
 Processes all entries in the log queue.

Static Public Member Functions

static Loggerget_instance ()
 Returns a reference to the static logger instance.

Member Function Documentation

◆ custom_log()

void Logger::custom_log ( esp_log_level_t level,
const char * tag,
const char * format,
... ) const

Either directly invokes render_to_console (real mode) or sends to the queue (queue mode).

Parameters
levelThe logging level to use
tagThe tag to log with
formatThe format string to use (printf-style)
...The varadic argument list of the format string

◆ get_instance()

Logger & Logger::get_instance ( )
inlinestatic

Returns a reference to the static logger instance.

Note
The instance will be created on the first call of this function
Returns
Reference to the logger object

◆ print_linefeed()

void Logger::print_linefeed ( ) const

Prints a \n in the currently selected mode.

◆ process_log_queue()

void Logger::process_log_queue ( ) const

Processes all entries in the log queue.

Note
Blocks execution if queue is empty and waits for new entries, so use in a seperate task!

◆ switch_to_queue_logging()

void Logger::switch_to_queue_logging ( QueueHandle_t log_queue_handle)

Switches the logger's mode to queue logging.

Parameters
log_queue_handleThe queue handle of the queue where logs will be sent to

The documentation for this class was generated from the following files: