SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
sgct::Log Class Reference

#include <sgct/log.h>

Public Types

enum class  Level { Error = 3 , Warning = 2 , Info = 1 , Debug = 0 }
 Different notify levels for messages. More...

Public Member Functions

void setNotifyLevel (Level nl)
 Set the notify level for displaying messages.
void setShowTime (bool state)
 Set whether time of day should be displayed with each print message.
void setShowLogLevel (bool state)
 Sets whether the log level should be displayed with each print message.
void setLogToConsole (bool state)
 Set if log to console should be enabled.
void setLogCallback (std::function< void(Level, std::string_view)> fn)
 Set the callback that gets invoked for each log.

Static Public Member Functions

static Log & instance ()
static void destroy ()
static void Debug (std::string_view message)
static void Warning (std::string_view message)
static void Info (std::string_view message)
static void Error (std::string_view message)

Member Enumeration Documentation

◆ Level

enum class sgct::Log::Level
strong

Different notify levels for messages.

Enumerator
Error 
Warning 
Info 
Debug 

Member Function Documentation

◆ Debug()

void sgct::Log::Debug ( std::string_view message)
static

◆ destroy()

void sgct::Log::destroy ( )
static

◆ Error()

void sgct::Log::Error ( std::string_view message)
static

◆ Info()

void sgct::Log::Info ( std::string_view message)
static

◆ instance()

Log & sgct::Log::instance ( )
static

◆ setLogCallback()

void sgct::Log::setLogCallback ( std::function< void(Level, std::string_view)> fn)

Set the callback that gets invoked for each log.

If you want to disable logging to the callback, pass a null function as a parameter.

◆ setLogToConsole()

void sgct::Log::setLogToConsole ( bool state)

Set if log to console should be enabled.

It is enabled on default.

◆ setNotifyLevel()

void sgct::Log::setNotifyLevel ( Level nl)

Set the notify level for displaying messages.

◆ setShowLogLevel()

void sgct::Log::setShowLogLevel ( bool state)

Sets whether the log level should be displayed with each print message.

◆ setShowTime()

void sgct::Log::setShowTime ( bool state)

Set whether time of day should be displayed with each print message.

◆ Warning()

void sgct::Log::Warning ( std::string_view message)
static

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