Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
drake::logging Namespace Reference

Namespaces

namespace  level

Classes

class  logger
 The singleton class returned by Drake's drake::log() function, offering functions to emit log messages. More...
struct  Warn
 When constructed, logs a message (at "warn" severity); the destructor is guaranteed to be trivial. More...

Enumerations

enum class  level_enum {
  trace , debug , info , warn ,
  err , critical , off
}
 The severity level associated with a log message. More...

Functions

std::string set_log_level (const std::string &level)
 Sets the log threshold used by Drake's C++ code.
void set_log_pattern (const std::string &pattern)
 Invokes drake::log()->set_pattern(pattern).
spdlog::sinks::dist_sink_mt * get_dist_sink ()
 (Advanced) Retrieves the default sink for all Drake logs.

Variables

const char *const kSetLogLevelUnchanged
 The "unchanged" string to pass to set_log_level() so as to achieve a no-op.
const char *const kSetLogLevelHelpMessage
 An end-user help string suitable to describe the effects of set_log_level().
const char *const kSetLogPatternHelpMessage
 An end-user help string suitable to describe the effects of set_log_pattern().

Enumeration Type Documentation

◆ level_enum

enum class level_enum
strong

The severity level associated with a log message.

Specfic values are named like drake::logging::level::info, etc.

Enumerator
trace 
debug 
info 
warn 
err 
critical 
off 

Function Documentation

◆ get_dist_sink()

spdlog::sinks::dist_sink_mt * get_dist_sink ( )

(Advanced) Retrieves the default sink for all Drake logs.

This allows consumers of Drake to redirect Drake's text logs to locations other than the default of stderr.

◆ set_log_level()

std::string set_log_level ( const std::string & level)

Sets the log threshold used by Drake's C++ code.

This has no effect unless spdlog is enabled.

Parameters
levelMust be a string from level enumeration: trace, debug, info, warn, err, critical, off, or unchanged (not an enum, but useful for command-line).
Returns
The string value of the previous log level.

◆ set_log_pattern()

void set_log_pattern ( const std::string & pattern)

Invokes drake::log()->set_pattern(pattern).

This has no effect unless spdlog is enabled.

Parameters
patternFormatting for message. For more information, see: https://github.com/gabime/spdlog/wiki/3.-Custom-formatting

Variable Documentation

◆ kSetLogLevelHelpMessage

const char* const kSetLogLevelHelpMessage
extern

An end-user help string suitable to describe the effects of set_log_level().

◆ kSetLogLevelUnchanged

const char* const kSetLogLevelUnchanged
extern

The "unchanged" string to pass to set_log_level() so as to achieve a no-op.

◆ kSetLogPatternHelpMessage

const char* const kSetLogPatternHelpMessage
extern

An end-user help string suitable to describe the effects of set_log_pattern().