Table of Contents

Class WitLogger

A thin wrapper around Unity's Debug logging API that supports a global enable/disable toggle via EnableLogging. Use this instead of Debug.Log directly so that all logging can be silenced in production builds from a single flag.

public static class WitLogger
Inheritance
WitLogger
Inherited Members

Fields

EnableLogging

When false, all log calls become no-ops. Set to false in release builds to eliminate logging overhead.

public static bool EnableLogging

Field Value

bool

Methods

Log(string)

Logs a plain informational message to the Unity console.

public static void Log(string message)

Parameters

message string

The message to log.

LogError(string)

Logs an error message (red) to the Unity console.

public static void LogError(string message)

Parameters

message string

The error message to log.

LogErrorFormat(string, params object[])

Logs a formatted error message using Format(IFormatProvider, string, object) syntax.

public static void LogErrorFormat(string format, params object[] args)

Parameters

format string

A composite format string.

args object[]

Arguments to format into the string.

LogException(Exception)

Logs an exception to the Unity console, printing the stack trace.

public static void LogException(Exception exception)

Parameters

exception Exception

The exception to log.

LogFormat(string, params object[])

Logs a formatted informational message using Format(IFormatProvider, string, object) syntax.

public static void LogFormat(string format, params object[] args)

Parameters

format string

A composite format string.

args object[]

Arguments to format into the string.

LogWarning(string)

Logs a warning message (yellow) to the Unity console.

public static void LogWarning(string message)

Parameters

message string

The warning message to log.

LogWarningFormat(string, params object[])

Logs a formatted warning message using Format(IFormatProvider, string, object) syntax.

public static void LogWarningFormat(string format, params object[] args)

Parameters

format string

A composite format string.

args object[]

Arguments to format into the string.