M5Unified
m5::Log_Class Class Reference

#include <Log_Class.hpp>

Public Member Functions

void operator() (esp_log_level_t level, const char *format,...)
 Output log. More...
 
void printf (const char *format,...)
 
void print (const char *string)
 
void println (const char *string)
 
void println (void)
 
void setEnableColor (log_target_t target, bool enable)
 Set whether or not to change the color for each log level. More...
 
bool getEnableColor (log_target_t target) const
 Get whether or not to change the color for each log level. More...
 
void setLogLevel (log_target_t target, esp_log_level_t level)
 Set log level. More...
 
esp_log_level_t getLogLevel (log_target_t target) const
 Get log level for serial output. More...
 
void setSuffix (log_target_t target, const char *suffix)
 Set the text to be added to the end of the log. More...
 
void setCallback (std::function< void(esp_log_level_t log_level, bool use_color, const char *log_text)> function)
 
void setDisplay (M5GFX *target)
 
void setDisplay (M5GFX &target)
 

Static Public Member Functions

static const char * pathToFileName (const char *path)
 not for use. More...
 

Detailed Description

Definition at line 48 of file Log_Class.hpp.

Member Function Documentation

◆ getEnableColor()

bool m5::Log_Class::getEnableColor ( log_target_t  target) const
inline

Get whether or not to change the color for each log level.

Definition at line 74 of file Log_Class.hpp.

◆ getLogLevel()

esp_log_level_t m5::Log_Class::getLogLevel ( log_target_t  target) const
inline

Get log level for serial output.

Definition at line 80 of file Log_Class.hpp.

◆ operator()()

void m5::Log_Class::operator() ( esp_log_level_t  level,
const char *  format,
  ... 
)

Output log.

Definition at line 35 of file Log_Class.cpp.

◆ pathToFileName()

const char * m5::Log_Class::pathToFileName ( const char *  path)
static

not for use.

Definition at line 18 of file Log_Class.cpp.

◆ print()

void m5::Log_Class::print ( const char *  string)
inline

Output text.

Attention
Output regardless of log level setting.

Definition at line 60 of file Log_Class.hpp.

Here is the call graph for this function:

◆ printf()

void m5::Log_Class::printf ( const char *  format,
  ... 
)

Output text in a specified format.

Attention
Output regardless of log level setting.

Definition at line 44 of file Log_Class.cpp.

Here is the caller graph for this function:

◆ println() [1/2]

void m5::Log_Class::println ( const char *  string)
inline

Output text with line feeds.

Attention
Output regardless of log level setting.

Definition at line 64 of file Log_Class.hpp.

Here is the call graph for this function:

◆ println() [2/2]

void m5::Log_Class::println ( void  )
inline

Output line feeds.

Attention
Output regardless of log level setting.

Definition at line 68 of file Log_Class.hpp.

Here is the call graph for this function:

◆ setCallback()

void m5::Log_Class::setCallback ( std::function< void(esp_log_level_t log_level, bool use_color, const char *log_text)>  function)
inline

set logging callback function / functor .

Parameters
functionPointer to a user-defined function that takes three arguments: esp_log_level_t , bool, const char*.

Definition at line 87 of file Log_Class.hpp.

◆ setDisplay() [1/2]

void m5::Log_Class::setDisplay ( M5GFX &  target)
inline

Set the display to show logs.

Parameters
targettarget display.

Definition at line 95 of file Log_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDisplay() [2/2]

void m5::Log_Class::setDisplay ( M5GFX *  target)

Set the display to show logs.

Parameters
targettarget display.

Definition at line 144 of file Log_Class.cpp.

Here is the caller graph for this function:

◆ setEnableColor()

void m5::Log_Class::setEnableColor ( log_target_t  target,
bool  enable 
)
inline

Set whether or not to change the color for each log level.

Definition at line 71 of file Log_Class.hpp.

◆ setLogLevel()

void m5::Log_Class::setLogLevel ( log_target_t  target,
esp_log_level_t  level 
)
inline

Set log level.

Definition at line 77 of file Log_Class.hpp.

◆ setSuffix()

void m5::Log_Class::setSuffix ( log_target_t  target,
const char *  suffix 
)
inline

Set the text to be added to the end of the log.

Definition at line 83 of file Log_Class.hpp.


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