AsyncFw 1.2
Async Framework is c++ runtime with timers, poll notifiers, sockets, coroutines, etc.
 
Loading...
Searching...
No Matches
AsyncFw::LogStream Class Reference

The LogStream class. More...

#include <AsyncFw/LogStream>

Public Types

enum  MessageType : uint8_t {
  Emergency = 0x00 , Alert = 0x01 , Error = 0x02 , Warning = 0x03 ,
  Notice = 0x04 , Info = 0x05 , Debug = 0x06 , Trace = 0x07
}
 
enum  Output : uint8_t { NoConsole = 0x08 }
 
enum  Color : uint8_t {
  Default = 0x00 , White = 0x10 , Gray = 0x20 , Black = 0x30 ,
  Red = 0x40 , Green = 0x50 , Blue = 0x60 , Cyan = 0x70 ,
  Magenta = 0x80 , Yellow = 0x90 , DarkRed = 0xa0 , DarkGreen = 0xb0 ,
  DarkBlue = 0xc0 , DarkCyan = 0xd0 , DarkMagenta = 0xe0 , DarkYellow = 0xf0
}
 

Public Member Functions

 LogStream (uint8_t, const char *, const char *, int, uint8_t=0)
 
template<typename T>
LogStreamoperator<< (T val)
 
LogStreamoperator<< (decltype(std::endl< char, std::char_traits< char > >) &)
 
LogStreamoperator<< (const Color)
 
LogStreamoperator<< (const int8_t)
 
LogStreamoperator<< (const uint8_t)
 
LogStreamoperator<< (const char *)
 
LogStreamoperator<< (char *)
 
template<typename... Args>
LogStreamoutput (std::format_string< Args... > msg, Args &&...args)
 
LogStreamoutput ()
 
LogStreamoutput (const std::string &)
 
LogStreamspace ()
 
LogStreamnospace ()
 
LogStreamflush ()
 

Static Public Member Functions

static void message (const Message &m, uint8_t f=LOG_STREAM_CONSOLE_COLOR|LOG_STREAM_CONSOLE_EXTEND)
 
static void console_output (const Message &, uint8_t=LOG_STREAM_CONSOLE_COLOR|LOG_STREAM_CONSOLE_EXTEND)
 
static std::string levelName (uint8_t)
 
static std::string colorString (Color)
 
static std::string sender (const char *)
 
static std::string timeString (const uint64_t, const TimeFormat &={})
 
static std::string currentTimeString (const TimeFormat &={})
 
static void setTimeFormat (const std::string &, bool=false)
 
static void setTimeOffset (int)
 
static void setCompleted (void(*_completed)(const Message &, uint8_t))
 
static void setFunctionPrefixIgnoreList (const std::vector< std::string > &list)
 
static void setSenderPrefix (const std::string &prefix)
 

Detailed Description

The LogStream class.

Examlpe:

lsTrace() << "Trace";
lsDebug() << "Debug";
lsInfo() << "Info";
lsInfoRed() << "Info red";
lsInfoGreen() << "Info green";
lsInfoBlue() << "Info blue";
lsInfoMagenta() << "Info magenta";
lsInfoCyan() << "Info cyan";
lsNotice() << "Notice";
lsWarning() << "Warning";
lsError() << "Error";
logTrace() << "Trace";
logDebug() << "Debug";
logInfo() << "Info";
logNotice() << "Notice";
logWarning() << "Warning";
logError() << "Error";
logAlert() << "logAlert";
logEmergency() << "Emergency"; // terminate

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