Handles Astra logging messages in C# allowing filtering and redirection
More...
|
| static void | LogTrace (object message) |
| | Highly verbose output, generally traces through entry points in stages, useful for debugging when you need to see what is firing when. More...
|
| |
| static void | LogDebug (object message) |
| | Used when outputting debugging information, such as object info, should only be shown when trying to debug something More...
|
| |
| static void | Log (object message) |
| | A one-to-one with UnityEngine.Debug.Log, records as Info level More...
|
| |
| static void | LogWarning (object message) |
| | A one-to-one with UnityEngine.Debug.LogWarning, records as Info level More...
|
| |
| static void | LogError (object message) |
| | A one-to-one with UnityEngine.Debug.LogError, records as Info level More...
|
| |
| static void | LogException (System.Exception exception) |
| | A one-to-one with UnityEngine.Debug.LogException, records as Error level More...
|
| |
| static void | Write (LogLevel level, string message) |
| | Formats and writes the string to console and/or file More...
|
| |
|
|
static string | path = null |
| | If we're being told to write to a file this is the path we want to write into, set to null to disable writes
|
| |
|
static LogLevel | maxLogLevel = LogLevel.Trace |
| | How much logging do we want to record to the console, by default this is set to trace meaning you will see all messages
|
| |
|
static bool | enabled = true |
| | Used to easily toggle logging w/o changing the levels
|
| |
|
static bool | withPrefixLevel = false |
| | Setting this to true will prepend a block with the type that matches Astra's c++ log eg: [DEBUG]
|
| |
|
static bool | withPrefixTimestamp = false |
| | Setting this to true will perpend a timestamp that matches Astra's c++ log eg: 2021-11-16 08:31:46.0824
|
| |
|
|
static OnWriteHandler | OnBeforeWrite |
| | Just before this class geneartes a log entry you're given a chance to take over, if you return false from this event it will abandon it's own logging
|
| |
Handles Astra logging messages in C# allowing filtering and redirection
◆ LogLevel
This is a denormalized copy of both Astra's C# and C++ log levels they are one-to-one
| Enumerator |
|---|
| None | No logging enabled
|
| Fatal | Only fatal errors where Astra does not know how to respond
|
| Error | Error and higher level logs
|
| Warn | Warnings and higher level logs
|
| Info | Info and higher level logs
|
| Debug | Debugging information and higher level logs
|
| Trace | Trace level information and higher level logs (note this generates a lot of information especially in the native layer)
|
◆ Log()
| static void Astra.Logger.Log |
( |
object |
message | ) |
|
|
inlinestatic |
◆ LogDebug()
| static void Astra.Logger.LogDebug |
( |
object |
message | ) |
|
|
inlinestatic |
Used when outputting debugging information, such as object info, should only be shown when trying to debug something
- Parameters
-
◆ LogError()
| static void Astra.Logger.LogError |
( |
object |
message | ) |
|
|
inlinestatic |
◆ LogException()
| static void Astra.Logger.LogException |
( |
System.Exception |
exception | ) |
|
|
inlinestatic |
A one-to-one with UnityEngine.Debug.LogException, records as Error level
- Parameters
-
| exception | The exception to record |
◆ LogTrace()
| static void Astra.Logger.LogTrace |
( |
object |
message | ) |
|
|
inlinestatic |
Highly verbose output, generally traces through entry points in stages, useful for debugging when you need to see what is firing when.
- Parameters
-
◆ LogWarning()
| static void Astra.Logger.LogWarning |
( |
object |
message | ) |
|
|
inlinestatic |
◆ OnWriteHandler()
| delegate bool Astra.Logger.OnWriteHandler |
( |
LogLevel |
level, |
|
|
string |
message |
|
) |
| |
Used in OnBeforeWrite to give you a chance to take over the log
- Parameters
-
| level | The incomining log level for the messge, unfiltered |
| message | The incominig raw message, unfiltered |
- Returns
- Return false if you want to stop this class from continuing to process the log, true if you want it to continue running
◆ Write()
| static void Astra.Logger.Write |
( |
LogLevel |
level, |
|
|
string |
message |
|
) |
| |
|
inlinestatic |
Formats and writes the string to console and/or file
- Parameters
-
| level | The level you want to record the message as |
| message | The informational block |
The documentation for this class was generated from the following file: