Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Quantum.Log Class Reference

Quantum's logging system. More...

Public Member Functions

delegate LogStream CreateLogStreamDelegate (LogLevel level, LogFlags flags, TraceChannels channel)
 A delegate to create a log stream. More...
 

Static Public Member Functions

static void Debug (object msg)
 Logs a message if DEBUG is defined. More...
 
static void Debug (string message)
 Logs a debug message. DEBUG needs to be defined and at least LogLevel.Debug must have been used to initialize the logger. More...
 
static void DebugError (object msg)
 Logs an error if DEBUG is defined. More...
 
static void DebugError (string message)
 Logs a debug error message. DEBUG needs to be defined and at least LogLevel.Debug must have been used to initialize the logger. More...
 
static void DebugWarn (object msg)
 Logs a warning if DEBUG is defined. More...
 
static void DebugWarn (string message)
 Logs a debug warning message. DEBUGneeds to be defined and at least LogLevel.Debug must have been used to initialize the logger. More...
 
static void Dispose ()
 Uninitializes the logger. All log streams are disposed. More...
 
static void Error (ILogSource logSource, string message)
 Logs an error message. At least LogLevel.Error must have been used to initialize the logger. More...
 
static void Error (object msg)
 Logs a message of Error type. More...
 
static void Error (string message)
 Logs an error message. At least LogLevel.Error must have been used to initialize the logger. More...
 
static void Exception (Exception ex)
 Logs an exception message. At least LogLevel.Error must have been used to initialize the logger. More...
 
static void Exception (ILogSource source, string message, Exception ex)
 Logs an exception message. At least LogLevel.Error must have been used to initialize the logger. More...
 
static void Exception (string message, Exception ex)
 Logs an exception message. At least LogLevel.Error must have been used to initialize the logger. More...
 
static void Info (ILogSource logSource, string message)
 Logs a message. At least LogLevel.Info must have been used to initialize the logger. More...
 
static void Info (object msg)
 Logs a message of Info type. More...
 
static void Info (string message)
 Logs a message. DEBUG needs to be defined and at least LogLevel.Info must have been used to initialize the logger. More...
 
static void Init (Action< string > info, Action< string > warn, Action< string > error, Action< Exception > exn)
 Use Initialize(LogLevel,CreateLogStreamDelegate,TraceChannels) instead. More...
 
static void InitForConsole ()
 Use InitializeForConsole instead. More...
 
static void InitForConsole (LogType logType)
 Use InitializeForConsole instead. More...
 
static void Initialize (LogLevel logLevel, CreateLogStreamDelegate streamFactory, TraceChannels traceChannels=default)
 Initializes the logger with the specified log level and trace channels. More...
 
static void Initialize (LogSettings settings, CreateLogStreamDelegate streamFactory)
 Initialize(LogLevel,CreateLogStreamDelegate,TraceChannels) More...
 
static void InitializeForConsole (LogLevel logLevel, TraceChannels traceChannels=default)
 Initializes the logger to log to the console. More...
 
static void InitializeForConsole (LogSettings settings)
 Initializes the logger to log to the console. More...
 
static void Trace (object msg)
 Logs a message if TRACE is defined. More...
 
static void TraceError (object msg)
 Logs an error if TRACE is defined. More...
 
static void TraceWarn (object msg)
 Logs a warning if TRACE is defined. More...
 
static void Warn (ILogSource logSource, string message)
 Logs a warning message. At least LogLevel.Warn must have been used to initialize the logger. More...
 
static void Warn (object msg)
 Logs a message of Warn type. More...
 
static void Warn (string message)
 Logs a warning message. At least LogLevel.Warn must have been used to initialize the logger. More...
 

Static Public Attributes

static bool Initialized => Log.IsInitialized
 Use IsInitialized instead. More...
 

Properties

static bool IsInitialized [get]
 Whether the logger is initialized. More...
 
static LogSettings Settings [get]
 Current log settings. More...
 

Detailed Description

Quantum's logging system.

Global logging class. Needs to be initialized before use. When in Unity, "QuantumLogInitializer" takes care of that. All static methods have conditional compilation directives:

Trace channels are enabled separately with QUANTUM_TRACE_* directives.

Member Function Documentation

◆ Trace()

static void Quantum.Log.Trace ( object  msg)
static

Logs a message if TRACE is defined.

Parameters
msgThe message to log.

◆ TraceWarn()

static void Quantum.Log.TraceWarn ( object  msg)
static

Logs a warning if TRACE is defined.

Parameters
msgThe message to log.

◆ TraceError()

static void Quantum.Log.TraceError ( object  msg)
static

Logs an error if TRACE is defined.

Parameters
msgThe message to log.

◆ Debug() [1/2]

static void Quantum.Log.Debug ( object  msg)
static

Logs a message if DEBUG is defined.

Parameters
msgThe message to log.

◆ DebugWarn() [1/2]

static void Quantum.Log.DebugWarn ( object  msg)
static

Logs a warning if DEBUG is defined.

Parameters
msgThe message to log.

◆ DebugError() [1/2]

static void Quantum.Log.DebugError ( object  msg)
static

Logs an error if DEBUG is defined.

Parameters
msgThe message to log.

◆ Info() [1/3]

static void Quantum.Log.Info ( object  msg)
inlinestatic

Logs a message of Info type.

Parameters
msgThe message to log.

◆ Warn() [1/3]

static void Quantum.Log.Warn ( object  msg)
inlinestatic

Logs a message of Warn type.

Parameters
msgThe message to log.

◆ Error() [1/3]

static void Quantum.Log.Error ( object  msg)
inlinestatic

Logs a message of Error type.

Parameters
msgThe message to log.

◆ Dispose()

static void Quantum.Log.Dispose ( )
inlinestatic

Uninitializes the logger. All log streams are disposed.

◆ CreateLogStreamDelegate()

delegate LogStream Quantum.Log.CreateLogStreamDelegate ( LogLevel  level,
LogFlags  flags,
TraceChannels  channel 
)

A delegate to create a log stream.

◆ Initialize() [1/2]

static void Quantum.Log.Initialize ( LogLevel  logLevel,
CreateLogStreamDelegate  streamFactory,
TraceChannels  traceChannels = default 
)
inlinestatic

Initializes the logger with the specified log level and trace channels.

Parameters
logLevelThe minimal log level. All messages with lower level are not going to be reported, regardless of QUANTUM_LOGLEVEL defines.
traceChannelsTrace channels to activate. Trace channels not included will not get reported, regardless of QUANTUM_TRACE defines.
streamFactory

◆ Initialize() [2/2]

static void Quantum.Log.Initialize ( LogSettings  settings,
CreateLogStreamDelegate  streamFactory 
)
inlinestatic

◆ InitializeForConsole() [1/2]

static void Quantum.Log.InitializeForConsole ( LogSettings  settings)
inlinestatic

Initializes the logger to log to the console.

Parameters
settings

◆ InitializeForConsole() [2/2]

static void Quantum.Log.InitializeForConsole ( LogLevel  logLevel,
TraceChannels  traceChannels = default 
)
static

Initializes the logger to log to the console.

◆ Debug() [2/2]

static void Quantum.Log.Debug ( string  message)
static

Logs a debug message. DEBUG needs to be defined and at least LogLevel.Debug must have been used to initialize the logger.

◆ DebugWarn() [2/2]

static void Quantum.Log.DebugWarn ( string  message)
static

Logs a debug warning message. DEBUGneeds to be defined and at least LogLevel.Debug must have been used to initialize the logger.

◆ DebugError() [2/2]

static void Quantum.Log.DebugError ( string  message)
static

Logs a debug error message. DEBUG needs to be defined and at least LogLevel.Debug must have been used to initialize the logger.

◆ Info() [2/3]

static void Quantum.Log.Info ( string  message)
static

Logs a message. DEBUG needs to be defined and at least LogLevel.Info must have been used to initialize the logger.

◆ Info() [3/3]

static void Quantum.Log.Info ( ILogSource  logSource,
string  message 
)
static

Logs a message. At least LogLevel.Info must have been used to initialize the logger.

◆ Warn() [2/3]

static void Quantum.Log.Warn ( string  message)
static

Logs a warning message. At least LogLevel.Warn must have been used to initialize the logger.

◆ Warn() [3/3]

static void Quantum.Log.Warn ( ILogSource  logSource,
string  message 
)
static

Logs a warning message. At least LogLevel.Warn must have been used to initialize the logger.

◆ Error() [2/3]

static void Quantum.Log.Error ( string  message)
static

Logs an error message. At least LogLevel.Error must have been used to initialize the logger.

◆ Error() [3/3]

static void Quantum.Log.Error ( ILogSource  logSource,
string  message 
)
static

Logs an error message. At least LogLevel.Error must have been used to initialize the logger.

◆ Exception() [1/3]

static void Quantum.Log.Exception ( Exception  ex)
static

Logs an exception message. At least LogLevel.Error must have been used to initialize the logger.

◆ Exception() [2/3]

static void Quantum.Log.Exception ( string  message,
Exception  ex 
)
static

Logs an exception message. At least LogLevel.Error must have been used to initialize the logger.

◆ Exception() [3/3]

static void Quantum.Log.Exception ( ILogSource  source,
string  message,
Exception  ex 
)
static

Logs an exception message. At least LogLevel.Error must have been used to initialize the logger.

◆ InitForConsole() [1/2]

static void Quantum.Log.InitForConsole ( )
inlinestatic

Use InitializeForConsole instead.

◆ InitForConsole() [2/2]

static void Quantum.Log.InitForConsole ( LogType  logType)
inlinestatic

Use InitializeForConsole instead.

◆ Init()

static void Quantum.Log.Init ( Action< string >  info,
Action< string >  warn,
Action< string >  error,
Action< Exception exn 
)
inlinestatic

Member Data Documentation

◆ Initialized

bool Quantum.Log.Initialized => Log.IsInitialized
static

Use IsInitialized instead.

Property Documentation

◆ IsInitialized

bool Quantum.Log.IsInitialized
staticget

Whether the logger is initialized.

◆ Settings

LogSettings Quantum.Log.Settings
staticget

Current log settings.