esp::logging namespace

logging library

Namespaces

namespace impl

Classes

class LoggingContext
Logging context that tracks which logging statements are enabled.

Enums

enum class Subsystem: uint8_t { Default, gfx, scene, sim, physics, nav, metadata, geo, io, URDF, core, assets, sensor, agent, NumSubsystems }
Habitat-Sim logging subsystems.
enum class LoggingLevel: uint8_t { VeryVerbose, Debug, Warning, Error, Verbose = Debug, Default = Warning, Quiet = Error }
Habitat-Sim logging levels. If the logging level for log macro is greater than or equal to the logging level within that subsystem, the log will be printed.

Functions

auto subsystemFromName(Corrade::Containers::StringView name) -> Subsystem
auto levelFromName(Corrade::Containers::StringView name) -> LoggingLevel
auto isLevelEnabled(Subsystem subsystem, LoggingLevel level) -> bool
Determine if the specified logging level is enabled within a given subsystem.
auto buildMessagePrefix(Subsystem subsystem, const std::string& msgLevel, const std::string& filename, const std::string& function, int line) -> Corrade::Containers::String
Build appropriate prefix for logging messages, including subsystem/namespace, file, line number and function name.

Variables

const char* subsystemNames constexpr

Enum documentation

enum class esp::logging::Subsystem: uint8_t

Habitat-Sim logging subsystems.

These are all subsystems that have different logging levels. They correspond to namespaces. When adding a new subsystem, make sure to add an appropriate loggingSubsystem function (see the ESP_ADD_SUBSYSTEM_FN helper bellow) and add it to subsystemNames.

Enumerators
Default

Catch all subsystem that is used when no subsystem is specified.

gfx

scene

sim

physics

nav

metadata

geo

io

URDF

core

assets

sensor

agent

NumSubsystems

Not a subsystem. Simply tracks how many subsystems there are.

Must always be last

enum class esp::logging::LoggingLevel: uint8_t

Habitat-Sim logging levels. If the logging level for log macro is greater than or equal to the logging level within that subsystem, the log will be printed.

The convenience levels, Verbose, Default and Quiet are the primary user facing options. Quiet turns off logging for all but errors, Default is the default and shows warnings and errors, while Verbose gives debug messages along with warnings and errors. These names exist such that logging levels can be added and removed without users needing to change what they set logging to.

Enumerators
VeryVerbose

Logging level to be used to provide in depth information about a process and its result.

Debug

Logging level to be used to specify the result of some process.

Warning

Logging level to be used to denote that some process has yielded a result that may not be appropriate or expected.

Error

Logging level to be used to denote that some process has failed.

Verbose

Enables all logging except for the most verbose statements. Habitat-Sim will be fairly verbose in this setting, but not overly so.

Default

The default logging level. Enables all warning and error messages but hides debug and verbose messages.

Quiet

Turns of all non-critical logging messages, i.e. those that indicate that something has gone wrong.

Function documentation

bool esp::logging::isLevelEnabled(Subsystem subsystem, LoggingLevel level)

Determine if the specified logging level is enabled within a given subsystem.

Parameters
subsystem in The name of the subsystem. Typically this is returned by espLoggingSubsystem
level in The logging level

Requires an active LoggingContext

Corrade::Containers::String esp::logging::buildMessagePrefix(Subsystem subsystem, const std::string& msgLevel, const std::string& filename, const std::string& function, int line)

Build appropriate prefix for logging messages, including subsystem/namespace, file, line number and function name.

Variable documentation

const char* esp::logging::subsystemNames constexpr