Hermes
hermes::Log Class Reference

Static class that manages logging messages. More...

Classes

struct  Location
 Holds information about log code location. More...
 

Static Public Member Functions

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void logMessage (logging_options message_options, const char *fmt, Location location, Ts &&...args)
 Logs a formatted message with code location information. More...
 
template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void logMessage (logging_options message_options, const char *fmt, Ts &&...args)
 Logs a formatted message. More...
 
template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void info (const char *fmt, Ts &&...args)
 Logs into info stream. More...
 
template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void warn (const char *fmt, Ts &&...args)
 Logs into warn stream. More...
 
template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void error (const char *fmt, Ts &&...args)
 Logs into error stream. More...
 
template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void critical (const std::string &fmt, Ts &&...args)
 Logs into critical stream. More...
 
static void addOptions (logging_options options_to_add)
 Enables logging options. More...
 
static void removeOptions (logging_options options_to_remove)
 Disables logging options. More...
 

Static Public Attributes

static u8 info_color = 247
 info stream messages color
 
static u8 warn_color = 191
 warn stream messages color
 
static u8 error_color = 9
 error stream messages color
 
static u8 critical_color = 197
 critical stream messages color
 
static u8 info_label_color = 247
 info stream label color
 
static u8 warn_label_color = 191
 warn stream label color
 
static u8 error_label_color = 9
 error stream label color
 
static u8 critical_label_color = 197
 critical stream label color
 
static size_t abbreviation_size = 10
 size after abbreviation (in characters)
 
static std::function< void(const Str &, logging_options)> log_callback
 redirection callback
 
static std::function< void(const Str &)> info_callback
 info stream redirection callback
 
static std::function< void(const Str &)> warn_callback
 warn stream redirection callback
 
static std::function< void(const Str &)> error_callback
 error stream redirection callback
 
static std::function< void(const Str &)> critical_callback
 critical stream redirection callback
 

Detailed Description

Static class that manages logging messages.

Member Function Documentation

◆ addOptions()

static void hermes::Log::addOptions ( logging_options  options_to_add)
inlinestatic

Enables logging options.

Parameters
options_to_add

◆ critical()

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void hermes::Log::critical ( const std::string &  fmt,
Ts &&...  args 
)
inlinestatic

Logs into critical stream.

Template Parameters
Ts
Parameters
fmt
args

◆ error()

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void hermes::Log::error ( const char *  fmt,
Ts &&...  args 
)
inlinestatic

Logs into error stream.

Template Parameters
Ts
Parameters
fmt
args

◆ info()

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void hermes::Log::info ( const char *  fmt,
Ts &&...  args 
)
inlinestatic

Logs into info stream.

Template Parameters
Ts
Parameters
fmt
args

◆ logMessage() [1/2]

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void hermes::Log::logMessage ( logging_options  message_options,
const char *  fmt,
Location  location,
Ts &&...  args 
)
inlinestatic

Logs a formatted message with code location information.

Template Parameters
Ts
Parameters
message_options
fmt
location
args

◆ logMessage() [2/2]

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void hermes::Log::logMessage ( logging_options  message_options,
const char *  fmt,
Ts &&...  args 
)
inlinestatic

Logs a formatted message.

Template Parameters
Ts
Parameters
message_options
fmt
args

◆ removeOptions()

static void hermes::Log::removeOptions ( logging_options  options_to_remove)
inlinestatic

Disables logging options.

Parameters
options_to_remove

◆ warn()

template<typename ... Ts>
static HERMES_DEVICE_CALLABLE void hermes::Log::warn ( const char *  fmt,
Ts &&...  args 
)
inlinestatic

Logs into warn stream.

Template Parameters
Ts
Parameters
fmt
args

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