OpenVDB 14.0.0
Loading...
Searching...
No Matches
openvdb::v14_0::logging Namespace Reference

Classes

class  ConsoleSink
 The sink installed by default, writing to std::cerr. More...
struct  LevelScope
 Sets the level on construction and restores the previous level on destruction. More...
class  Sink
 Receives formatted log messages. Subclass this to route OpenVDB diagnostics into a host application. More...

Enumerations

enum class  Level {
  Debug = 0 , Info , Warn , Error ,
  Fatal
}
 Message severity level, in increasing order of severity. More...

Functions

Level getLevel ()
 Return the current severity threshold. Messages below this are dropped.
void setLevel (Level)
 Set the severity threshold. Messages below this are dropped.
bool isEnabledFor (Level)
 Return true if a message of the given level would be logged.
void setLevel (int &argc, char *argv[])
 If "-debug", "-info", "-warn", "-error" or "-fatal" is found in the given array of command-line arguments, set the logging level appropriately and remove the relevant argument(s) from the array.
void addSink (const Sink::Ptr &)
 Register a sink. Replaces any existing sink with the same name.
bool removeSink (const std::string &name)
 Remove the sink with the given name. Returns true if one was removed.
Sink::Ptr findSink (const std::string &name)
 Return the sink with the given name, or nullptr.
void initialize (bool useColor=ConsoleSink::stderrIsTerminal())
 Install the default console sink if no sink has been installed yet.
void initialize (int &argc, char *argv[], bool useColor=ConsoleSink::stderrIsTerminal())
 Initialize and then apply any level flags found in the arguments.

Enumeration Type Documentation

◆ Level

enum class Level
strong

Message severity level, in increasing order of severity.

Enumerator
Debug 
Info 
Warn 
Error 
Fatal 

Function Documentation

◆ addSink()

void addSink ( const Sink::Ptr & )

Register a sink. Replaces any existing sink with the same name.

◆ findSink()

Sink::Ptr findSink ( const std::string & name)

Return the sink with the given name, or nullptr.

◆ getLevel()

Level getLevel ( )

Return the current severity threshold. Messages below this are dropped.

◆ initialize() [1/2]

void initialize ( bool useColor = ConsoleSink::stderrIsTerminal())

Install the default console sink if no sink has been installed yet.

By default, color is enabled only if stderr is connected to a terminal.

◆ initialize() [2/2]

void initialize ( int & argc,
char * argv[],
bool useColor = ConsoleSink::stderrIsTerminal() )

Initialize and then apply any level flags found in the arguments.

By default, color is enabled only if stderr is connected to a terminal.

◆ isEnabledFor()

bool isEnabledFor ( Level )

Return true if a message of the given level would be logged.

Used by the logging macros to skip formatting a message that would be discarded. This is a single relaxed atomic load.

◆ removeSink()

bool removeSink ( const std::string & name)

Remove the sink with the given name. Returns true if one was removed.

◆ setLevel() [1/2]

void setLevel ( int & argc,
char * argv[] )

If "-debug", "-info", "-warn", "-error" or "-fatal" is found in the given array of command-line arguments, set the logging level appropriately and remove the relevant argument(s) from the array.

◆ setLevel() [2/2]

void setLevel ( Level )

Set the severity threshold. Messages below this are dropped.