Table of Contents

Class GridForgeUnityLogger

Namespace
GridForge.Utility

Optional Unity adapter that forwards GridForgeLogger messages into Unity logging.

[AddComponentMenu("GridForge/Debugging/GridForge Unity Logger")]
[DisallowMultipleComponent]
[ExecuteAlways]
public sealed class GridForgeUnityLogger : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
GridForgeUnityLogger
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Properties

ActiveLogger

Gets the component currently forwarding GridForge messages.

public static GridForgeUnityLogger ActiveLogger { get; }

Property Value

GridForgeUnityLogger

EnableOnComponentEnable

Gets or sets whether logging starts when the component is enabled.

public bool EnableOnComponentEnable { get; set; }

Property Value

bool

HasActiveLogger

Gets whether a Unity logger is currently active.

public static bool HasActiveLogger { get; }

Property Value

bool

IsLoggingEnabled

Gets whether this component currently owns GridForge logging.

public bool IsLoggingEnabled { get; }

Property Value

bool

MinimumLevel

Gets or sets the minimum diagnostic level forwarded to Unity.

public DiagnosticLevel MinimumLevel { get; set; }

Property Value

DiagnosticLevel

Methods

DisableLogging()

Restores the GridForge logger settings captured when EnableLogging() succeeded.

public void DisableLogging()

EnableLogging()

Installs this component as the active Unity sink for GridForge messages.

public bool EnableLogging()

Returns

bool

true when logging is enabled by this component; otherwise, false.

FormatUnityLogMessage(DiagnosticLevel, string, string)

Formats a GridForge diagnostic message for Unity logging.

public static string FormatUnityLogMessage(DiagnosticLevel level, string message, string source)

Parameters

level DiagnosticLevel

The diagnostic level.

message string

The message text.

source string

The optional diagnostic source.

Returns

string

The formatted Unity log message.

GetUnityLogType(DiagnosticLevel)

Maps a GridForge diagnostic level to a Unity log type.

public static LogType GetUnityLogType(DiagnosticLevel level)

Parameters

level DiagnosticLevel

The GridForge diagnostic level.

Returns

LogType

The corresponding Unity log type.