Sunshine latest
Self-hosted game stream host for Moonlight.
logging Namespace Reference

Handles the initialization and deinitialization of the logging system. More...

Classes

class  deinit_t
 
class  min_max_avg_periodic_logger
 A helper class for tracking and logging numerical values across a period of time. More...
 
class  time_delta_periodic_logger
 A helper class for tracking and logging short time intervals across a period of time. More...
 

Functions

std::string bracket (const std::string &input)
 Enclose string in square brackets.
 
std::wstring bracket (const std::wstring &input)
 Enclose string in square brackets.
 
void deinit ()
 Deinitialize the logging system.
 
void formatter (const boost::log::record_view &view, boost::log::formatting_ostream &os)
 
std::unique_ptr< deinit_tinit (int min_log_level, const std::string &log_file)
 Initialize the logging system.
 
void log_flush ()
 Flush the log.
 
void print_help (const char *name)
 Print help to stdout.
 
void setup_av_logging (int min_log_level)
 Setup AV logging.
 
void setup_libdisplaydevice_logging (int min_log_level)
 Setup logging for libdisplaydevice.
 

Detailed Description

Handles the initialization and deinitialization of the logging system.

Function Documentation

◆ bracket() [1/2]

std::string logging::bracket ( const std::string & input)

Enclose string in square brackets.

Parameters
inputInput string.
Returns
Enclosed string.

◆ bracket() [2/2]

std::wstring logging::bracket ( const std::wstring & input)

Enclose string in square brackets.

Parameters
inputInput string.
Returns
Enclosed string.

◆ deinit()

void logging::deinit ( )

Deinitialize the logging system.

Examples

void deinit()
Deinitialize the logging system.
Definition logging.cpp:50

◆ init()

std::unique_ptr< deinit_t > logging::init ( int min_log_level,
const std::string & log_file )

Initialize the logging system.

Parameters
min_log_levelThe minimum log level to output.
log_fileThe log file to write to.
Returns
An object that will deinitialize the logging system when it goes out of scope.

Examples

log_init(2, "sunshine.log");

◆ log_flush()

void logging::log_flush ( )

Flush the log.

Examples

void log_flush()
Flush the log.
Definition logging.cpp:186

◆ print_help()

void logging::print_help ( const char * name)

Print help to stdout.

Parameters
nameThe name of the program.

Examples

print_help("sunshine");
void print_help(const char *name)
Print help to stdout.
Definition logging.cpp:192

◆ setup_av_logging()

void logging::setup_av_logging ( int min_log_level)

Setup AV logging.

Parameters
min_log_levelThe log level.

◆ setup_libdisplaydevice_logging()

void logging::setup_libdisplaydevice_logging ( int min_log_level)

Setup logging for libdisplaydevice.

Parameters
min_log_levelThe log level.