Astra Unity 2.6.6
Astra Unity Plugin
Astra.Logger Class Reference

Handles Astra logging messages in C# allowing filtering and redirection More...

Public Types

enum  LogLevel {
  None = 0 , Fatal = 100 , Error = 200 , Warn = 300 ,
  Info = 400 , Debug = 500 , Trace = 600
}
 This is a denormalized copy of both Astra's C# and C++ log levels they are one-to-one More...
 

Public Member Functions

delegate bool OnWriteHandler (LogLevel level, string message)
 Used in OnBeforeWrite to give you a chance to take over the log More...
 

Static Public Member Functions

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 Public Attributes

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
 

Events

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
 

Detailed Description

Handles Astra logging messages in C# allowing filtering and redirection

Member Enumeration Documentation

◆ 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)

Member Function Documentation

◆ Log()

static void Astra.Logger.Log ( object  message)
inlinestatic

A one-to-one with UnityEngine.Debug.Log, records as Info level

Parameters
messageThe message to record
Examples
Examples/Avatars/LoadAnyUserAvatarByGuid.cs, Examples/Catalog/QueryingCatalog.cs, and Examples/GettingStarted/GettingStarted.cs.

◆ 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
message

◆ LogError()

static void Astra.Logger.LogError ( object  message)
inlinestatic

A one-to-one with UnityEngine.Debug.LogError, records as Info level

Parameters
messageThe message to record
Examples
Examples/Animation/AnimatingAnAvatar.cs, Examples/Avatars/LoadAnyUserAvatarByGuid.cs, and Examples/GettingStarted/GettingStarted.cs.

◆ LogException()

static void Astra.Logger.LogException ( System.Exception  exception)
inlinestatic

A one-to-one with UnityEngine.Debug.LogException, records as Error level

Parameters
exceptionThe 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
message

◆ LogWarning()

static void Astra.Logger.LogWarning ( object  message)
inlinestatic

A one-to-one with UnityEngine.Debug.LogWarning, records as Info level

Parameters
messageThe message to record
Examples
Examples/GettingStarted/GettingStarted.cs.

◆ OnWriteHandler()

delegate bool Astra.Logger.OnWriteHandler ( LogLevel  level,
string  message 
)

Used in OnBeforeWrite to give you a chance to take over the log

Parameters
levelThe incomining log level for the messge, unfiltered
messageThe 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
levelThe level you want to record the message as
messageThe informational block

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