Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
Static Public Member Functions | List of all members
SR::Log Class Reference

Class with static logging functionality. More...

#include <logging.h>

Static Public Member Functions

static void initialize (Verbosity verbosity, std::string logPath, std::string logFilePrefix)
 Initialize underlying logging implementation (GLog), logs both to file and console. More...
 
static void initializeToFile (Verbosity verbosity, std::string logPath, std::string logFilePrefix)
 Initialize underlying logging implementation (GLog) with file logging only. More...
 
static void debugInfo (std::string message)
 Logs an informative message if the compiled in debug mode. More...
 
static void info (std::string message)
 Logs an informative message. More...
 
static void warning (std::string message)
 Logs an warning message. More...
 
static void error (std::string message)
 Logs an error message. More...
 
static void flush ()
 Flushes the log. More...
 
static void initializeCrashCallBack ()
 

Detailed Description

Class with static logging functionality.

Third-party dependencies are not exposed when used in header files

Member Function Documentation

◆ debugInfo()

static void SR::Log::debugInfo ( std::string  message)
static

Logs an informative message if the compiled in debug mode.

Parameters
Messageto be displayed in debug mode

◆ error()

static void SR::Log::error ( std::string  message)
static

Logs an error message.

Ensures that the buffer is flushed and that message will be output.

Parameters
Messageto be displayed as error

◆ flush()

static void SR::Log::flush ( )
static

Flushes the log.

Ensures that the buffer is flushed and that all previous messages will be output.

◆ info()

static void SR::Log::info ( std::string  message)
static

Logs an informative message.

Parameters
Non-essentialmessage to be displayed as info

◆ initialize()

static void SR::Log::initialize ( Verbosity  verbosity,
std::string  logPath,
std::string  logFilePrefix 
)
static

Initialize underlying logging implementation (GLog), logs both to file and console.

Verbosity level can be set to LowVerbosity, MediumVerbosity, HighVerbosity or NoLogging. Default is set to LowVerbosity, for which only errors will be logged. MediumVerbosity - errors and warnings are logged. HighVerbosity - errors, warnings and info messages are logged. NoLogging - all logging messages are suppressed. When called a second time it will enable console logging

The underlying logger should only be initialized once. This function will check whether it has already been initialized but the check is not thread-safe. If you want to override the default SR logging behavior, call this function before constructing the first SRContext. Call this function from the same thread in which your SRContext object is constructed.

Parameters
-verbosity defines verbosity level to be set

◆ initializeCrashCallBack()

static void SR::Log::initializeCrashCallBack ( )
static

Call Google Crash handler (call back). This Should be call for each thread independently

◆ initializeToFile()

static void SR::Log::initializeToFile ( Verbosity  verbosity,
std::string  logPath,
std::string  logFilePrefix 
)
static

Initialize underlying logging implementation (GLog) with file logging only.

Verbosity level can be set to LowVerbosity, MediumVerbosity, HighVerbosity or NoLogging. Default is set to LowVerbosity, for which only errors will be logged. MediumVerbosity - errors and warnings are logged. HighVerbosity - errors, warnings and info messages are logged. NoLogging - all logging messages are suppressed. When called a second time it will disable console logging

The underlying logger should only be initialized once. This function will check whether it has already been initialized but the check is not thread-safe. This initialize function is invoked by the SRContext constructor by default. If you want to override the default SR logging behavior, call this function before constructing the first SRContext. Call this function from the same thread in which your SRContext object is constructed.

Parameters
-verbosity defines verbosity level to be set

◆ warning()

static void SR::Log::warning ( std::string  message)
static

Logs an warning message.

Parameters
Messageto be displayed as warning

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