Static logger class. More...
Public Types | |
enum class | Level : byte { ALL = 0xFF , PRODUCTION = 0xFE , DEBUG = 1 , INFO = 2 , WARNING = 4 , ERROR = 8 , FATAL = 16 } |
Log levels. More... | |
Public Member Functions | |
delegate void | LogHandler (Level level, string channel, string message, Exception exception, object context) |
Delegate for logging a message. More... | |
Static Public Member Functions | |
static void | Debug< T > (T channel, string message) |
Logs a debug message. More... | |
static void | Debug (string message) |
Logs a debug message to the root channel. More... | |
static void | Debug< T > (T channel, string message, object context) |
Logs a debug message. More... | |
static void | Debug (string message, object context) |
Logs a debug message to the root channel. More... | |
static void | Info< T > (T channel, string message) |
Logs an info message. More... | |
static void | Info (string message) |
Logs an info message to the root channel. More... | |
static void | Info< T > (T channel, string message, object context) |
Logs an info message. More... | |
static void | Info (string message, object context) |
Logs an info message to the root channel. More... | |
static void | Warning< T > (T channel, string message) |
Logs a warning. More... | |
static void | Warning (string message) |
Logs a warning to the root channel. More... | |
static void | Warning< T > (T channel, string message, object context) |
Logs a warning. More... | |
static void | Warning (string message, object context) |
Logs a warning to the root channel. More... | |
static void | Error< T > (T channel, string message) |
Logs an error. More... | |
static void | Error< T > (T channel, string message, Exception exception) |
Logs an error. More... | |
static void | Error (string message) |
Logs an error to the root channel. More... | |
static void | Error (string message, Exception exception) |
Logs an error to the root channel. More... | |
static void | Error< T > (T channel, string message, object context) |
Logs an error. More... | |
static void | Error< T > (T channel, string message, Exception exception, object context) |
Logs an error. More... | |
static void | Error (string message, object context) |
Logs an error to the root channel. More... | |
static void | Error (string message, Exception exception, object context) |
Logs an error to the root channel. More... | |
static void | LogException< T > (T channel, Exception exception) |
Logs an exception. More... | |
static void | LogException (Exception exception) |
Logs an exception to the root channel. More... | |
static void | LogException< T > (T channel, Exception exception, object context) |
Logs an exception. More... | |
static void | LogException (Exception exception, object context) |
Logs an exception to the root channel. More... | |
static void | Fatal< T > (T channel, string message, Exception exception=null) |
Logs a fatal error. More... | |
static void | Fatal (string message, Exception exception=null) |
Logs a fatal error to the root channel. More... | |
static void | Fatal< T > (T channel, string message, object context, Exception exception=null) |
Logs a fatal error. More... | |
static void | Fatal (string message, object context, Exception exception=null) |
Logs a fatal error to the root channel. More... | |
static void | FatalException< T > (T channel, Exception exception) |
Logs a fatal exception. More... | |
static void | FatalException (Exception exception) |
Logs a fatal exception to the root channel. More... | |
static void | FatalException< T > (T channel, Exception exception, object context) |
Logs a fatal exception. More... | |
static void | FatalException (Exception exception, object context) |
Logs a fatal exception to the root channel. More... | |
static void | RegisterHandler< T > (T channel, LogHandler handler, Level levelMask=Level.ALL, bool allowBubbling=true) |
Registers a log handler. More... | |
static void | RegisterHandler (LogHandler handler, Level levelMask=Level.ALL, bool allowBubbling=true) |
Registers a log handler to the root channel. More... | |
static bool | UnregisterHandler< T > (T channel, LogHandler handler) |
Unregisters a log handler. More... | |
static bool | UnregisterHandler (LogHandler handler) |
Unregisters a log handler from the root channel. More... | |
static void | LogToUnity (Level level, string channel, string message, Exception e, object context) |
Passes a log message to Unity's logger. More... | |
Static Public Attributes | |
const string | ROOT_CHANNEL = "Root" |
Name of the root channel. More... | |
const string | VERBOSE_CHANNEL = "Verbose" |
Name of the verbose channel. More... | |
const int | MAX_LENGTH = 15000 |
Maximum number of characters in a log statement before it is split up into multiple log statements. More... | |
Static logger class.
Log messages have a level and a channel string that can be used to filter log messages. Channels can have parent channels. Any message a channel receives will also be sent to all of it's parent channels. Channels are seperated by ".", with children channel following parents. All channels are children of the root channel. If a non-string object is passed as channel parameter T to a log function, the channel string will be [namespace.classname]. Example: ksLog.Info("X.Y", "This message will be received by channels 'X.Y', 'X', and 'Root');
|
strong |
Log levels.
|
static |
Logs a debug message to the root channel.
message | Message to log. |
|
static |
Logs a debug message to the root channel.
message | Message to log. |
context | Object related to this message. |
|
static |
Logs a debug message.
T |
channel | Channel to log to. |
message | Message to log. |
T | : | class |
|
static |
Logs a debug message.
T |
channel | Channel to log to. |
message | Message to log. |
context | Object related to this message. |
T | : | class |
|
static |
Logs an error to the root channel.
message | Message to log. |
|
static |
Logs an error to the root channel.
message | Message to log. |
exception | Exception to log. |
|
static |
Logs an error to the root channel.
message | Message to log. |
exception | Exception to log. |
context | Object related to this message. |
|
static |
Logs an error to the root channel.
message | Message to log. |
context | Object related to this message. |
|
static |
Logs an error.
T |
channel | Channel to log to. |
message | Message to log. |
T | : | class |
|
static |
Logs an error.
T |
channel | Channel to log to. |
message | Message to log. |
exception | Exception to log. |
T | : | class |
|
static |
Logs an error.
T |
channel | Channel to log to. |
message | Message to log. |
exception | Exception to log. |
context | Object related to this message. |
T | : | class |
|
static |
Logs an error.
T |
channel | Channel to log to. |
message | Message to log. |
context | Object related to this message. |
T | : | class |
|
static |
Logs a fatal error to the root channel.
message | Message to log. |
exception | Exception to log. |
|
static |
Logs a fatal error to the root channel.
message | Message to log. |
context | Object related to this message. |
exception | Exception to log. |
|
static |
Logs a fatal error.
T |
channel | Channel to log to. |
message | Message to log. |
exception | Exception to log. |
T | : | class |
|
static |
Logs a fatal error.
T |
channel | Channel to log to. |
message | Message to log. |
context | Object related to this message. |
exception | Exception to log. |
T | : | class |
|
static |
Logs a fatal exception to the root channel.
exception | Exception to log. |
|
static |
Logs a fatal exception to the root channel.
exception | Exception to log. |
context | Object related to this message. |
|
static |
Logs a fatal exception.
T |
channel | Channel to log to. |
exception | Exception to log. |
T | : | class |
|
static |
Logs a fatal exception.
T |
channel | Channel to log to. |
exception | Exception to log. |
context | Object related to this message. |
T | : | class |
|
static |
Logs an info message to the root channel.
message | Message to log. |
|
static |
Logs an info message to the root channel.
message | Message to log. |
context | Object related to this message. |
|
static |
Logs an info message.
T |
channel | Channel to log to. |
message | Message to log. |
T | : | class |
|
static |
Logs an info message.
T |
channel | Channel to log to. |
message | Message to log. |
context | Object related to this message. |
T | : | class |
|
static |
Logs an exception to the root channel.
exception | Exception to log. |
|
static |
Logs an exception to the root channel.
exception | Exception to log. |
context | Object related to this message. |
|
static |
Logs an exception.
T |
channel | Channel to log to. |
exception | Exception to log. |
T | : | class |
|
static |
Logs an exception.
T |
channel | Channel to log to. |
exception | Exception to log. |
context | Object related to this message. |
T | : | class |
delegate void KS.Reactor.ksLog.LogHandler | ( | Level | level, |
string | channel, | ||
string | message, | ||
Exception | exception, | ||
object | context | ||
) |
Delegate for logging a message.
level | Level of the message. |
channel | Channel the message was sent to. |
message | Message to log. May be null if exception is provided. |
exception | Exception to log. May be null if message is provided. |
context | Object related to this message. |
|
static |
Passes a log message to Unity's logger.
level | level of the message. |
channel | channel the message was sent to. |
message | message to log. May be null if exception is provided. |
exception | exception to log. May be null if message is provided. |
context | object related to this message. |
|
static |
Registers a log handler to the root channel.
handler | Handler to register. |
levelMask | Filters messages by level. |
allowBubbling | If false, logs handled by this handler will not be processed by handlers on parent channels. |
|
static |
Registers a log handler.
T |
channel | Channel to register to. |
handler | Handler to register. |
levelMask | Filters messages by level. |
allowBubbling | If false, logs handled by this handler will not be processed by handlers on parent channels. |
T | : | class |
|
static |
Unregisters a log handler from the root channel.
handler | Handler to unregister. |
|
static |
Unregisters a log handler.
T |
channel | Channel to unregister from. |
handler | Handler to unregister. |
T | : | class |
|
static |
Logs a warning to the root channel.
message | Message to log. |
|
static |
Logs a warning to the root channel.
message | Message to log. |
context | Object related to this message. |
|
static |
Logs a warning.
T |
channel | Channel to log to. |
message | Message to log. |
T | : | class |
|
static |
Logs a warning.
T |
channel | Channel to log to. |
message | Message to log. |
context | Object related to this message. |
T | : | class |
|
static |
Maximum number of characters in a log statement before it is split up into multiple log statements.
This is to prevent Unity from breaking because a log statement is too long. This is a bit shorter than Unity's maximum (16384) since some extra text is added to each message (log level, channel, etc.).
|
static |
Name of the root channel.
|
static |
Name of the verbose channel.