Quantum 3 3.1.0

Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Photon.Realtime.Log Class Reference

Static class to provide customizable log functionality. More...

Public Types

enum  LogOutputOption
 Enumerates options for log output stream. Default: Console. More...
 
enum  PrefixOptions
 Enumerates options for log prefixing. More...
 

Static Public Member Functions

static void Debug (string msg, LogLevel lvl=LogLevel.Debug, string prefix=null)
 Check level, format message and call onDebug to log. More...
 
static void Error (string msg, LogLevel lvl=LogLevel.Error, string prefix=null)
 Check level, format message and call onError to log. More...
 
static void Exception (Exception ex, LogLevel lvl=LogLevel.Error, string prefix=null)
 Check level, format message and call onException to log. More...
 
static void Info (string msg, LogLevel lvl=LogLevel.Info, string prefix=null)
 Check level, format message and call onInfo to log. More...
 
static void Init (Action< string > error, Action< string > warn, Action< string > info, Action< string > debug, Action< Exception, string > exception)
 Initialize the logging actions to custom actions. Note: These are initialized by default. More...
 
static void Init (LogOutputOption logOutput)
 Initializes the logging to selected output stream. LogPrefix is set to PrefixOptions.None. More...
 
static void Warn (string msg, LogLevel lvl=LogLevel.Warning, string prefix=null)
 Check level, format message and call onWarn to log. More...
 

Static Public Attributes

static PrefixOptions LogPrefix = PrefixOptions.None
 Prefix option for logging. More...
 

Detailed Description

Static class to provide customizable log functionality.

Member Enumeration Documentation

◆ PrefixOptions

Enumerates options for log prefixing.

Enumerator
None 

No prefix.

Time 

Prefix with timestamp.

Level 

Prefix with message's log level.

TimeAndLevel 

Prefix with timestamp and log level.

◆ LogOutputOption

Enumerates options for log output stream. Default: Console.

Enumerator
Auto 

Auto becomes UnityDebug if this is a Unity build. Defaults to: Console.

Console 

Logs via Console.WriteLine.

Debug 

Logs via Debug.WriteLine.

UnityDebug 

Logs via UnityEngine.Debug.Log.

Member Function Documentation

◆ Init() [1/2]

static void Photon.Realtime.Log.Init ( LogOutputOption  logOutput)
inlinestatic

Initializes the logging to selected output stream. LogPrefix is set to PrefixOptions.None.

Auto becomes UnityDebug if this is a Unity build. Defaults to: Console.

Parameters
logOutput

◆ Init() [2/2]

static void Photon.Realtime.Log.Init ( Action< string >  error,
Action< string >  warn,
Action< string >  info,
Action< string >  debug,
Action< Exception, string >  exception 
)
inlinestatic

Initialize the logging actions to custom actions. Note: These are initialized by default.

Parameters
errorLog errors.
warnLog warnings.
infoLog info.
debugLog debugging / tracing.
exceptionLog exceptions.

◆ Exception()

static void Photon.Realtime.Log.Exception ( Exception  ex,
LogLevel  lvl = LogLevel.Error,
string  prefix = null 
)
inlinestatic

Check level, format message and call onException to log.

Parameters
exThe exception to log.
lvlThe logging level of the instance that is about to log this message (if the level is equal or greater than this message.
prefixString to place in front of the actual message.

◆ Error()

static void Photon.Realtime.Log.Error ( string  msg,
LogLevel  lvl = LogLevel.Error,
string  prefix = null 
)
inlinestatic

Check level, format message and call onError to log.

Parameters
msgThe message to log.
lvlThe logging level of the instance that is about to log this message (if the level is equal or greater than this message.
prefixString to place in front of the actual message.

◆ Warn()

static void Photon.Realtime.Log.Warn ( string  msg,
LogLevel  lvl = LogLevel.Warning,
string  prefix = null 
)
inlinestatic

Check level, format message and call onWarn to log.

Parameters
msgThe message to log.
lvlThe logging level of the instance that is about to log this message (if the level is equal or greater than this message.
prefixString to place in front of the actual message.

◆ Info()

static void Photon.Realtime.Log.Info ( string  msg,
LogLevel  lvl = LogLevel.Info,
string  prefix = null 
)
inlinestatic

Check level, format message and call onInfo to log.

Parameters
msgThe message to log.
lvlThe logging level of the instance that is about to log this message (if the level is equal or greater than this message.
prefixString to place in front of the actual message.

◆ Debug()

static void Photon.Realtime.Log.Debug ( string  msg,
LogLevel  lvl = LogLevel.Debug,
string  prefix = null 
)
inlinestatic

Check level, format message and call onDebug to log.

Parameters
msgThe message to log.
lvlThe logging level of the instance that is about to log this message (if the level is equal or greater than this message.
prefixString to place in front of the actual message.

Member Data Documentation

◆ LogPrefix

PrefixOptions Photon.Realtime.Log.LogPrefix = PrefixOptions.None
static

Prefix option for logging.