maliput
maliput::drake::logging Namespace Reference

Classes

struct  Warn
 When constructed, logs a message (at "warn" severity); the destructor is guaranteed to be trivial. More...
 

Typedefs

using logger = spdlog::logger
 The maliput::drake::logging::logger class provides text logging methods. More...
 

Functions

sink * get_dist_sink ()
 (Advanced) Retrieves the default sink for all Drake logs. More...
 
std::string set_log_level (const std::string &level)
 Invokes drake::log()->set_level(level). More...
 
void set_log_pattern (const std::string &pattern)
 Invokes drake::log()->set_pattern(pattern). More...
 

Variables

constexpr bool kHaveSpdlog = true
 True only if spdlog is enabled in this build. More...
 
const char *const kSetLogLevelUnchanged = "unchanged"
 The "unchanged" string to pass to set_log_level() so as to achieve a no-op. More...
 
const char *const kSetLogLevelHelpMessage
 An end-user help string suitable to describe the effects of set_log_level(). More...
 
const char *const kSetLogPatternHelpMessage
 An end-user help string suitable to describe the effects of set_log_pattern(). More...
 

Typedef Documentation

◆ logger

using logger = spdlog::logger

The maliput::drake::logging::logger class provides text logging methods.

See the text_logging.h documentation for a short tutorial.

Function Documentation

◆ get_dist_sink()

logging::sink * get_dist_sink ( )

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

When spdlog is enabled, the return value can be cast to spdlog::sinks::dist_sink_mt and thus allows consumers of Drake to redirect Drake's text logs to locations other than the default of stderr. When spdlog is disabled, the return value is an empty class.

◆ set_log_level()

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

Invokes drake::log()->set_level(level).

Parameters
levelMust be a string from spdlog enumerations: 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. If SPDLOG is disabled, then this returns an empty string.

◆ set_log_pattern()

void set_log_pattern ( const std::string &  pattern)

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

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

Variable Documentation

◆ kHaveSpdlog

constexpr bool kHaveSpdlog = true
constexpr

True only if spdlog is enabled in this build.

◆ kSetLogLevelHelpMessage

const char *const kSetLogLevelHelpMessage
Initial value:
=
"sets the spdlog output threshold; possible values are "
"'unchanged', "
"'trace', "
"'debug', "
"'info', "
"'warn', "
"'err', "
"'critical', "
"'off'"

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

◆ kSetLogLevelUnchanged

const char *const kSetLogLevelUnchanged = "unchanged"

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

◆ kSetLogPatternHelpMessage

const char *const kSetLogPatternHelpMessage
Initial value:
=
"sets the spdlog pattern for formatting; for more information, see "
"https://github.com/gabime/spdlog/wiki/3.-Custom-formatting"

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