Class WitLogger
- Namespace
- WitShells.DesignPatterns
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
Methods
Log(string)
Logs a plain informational message to the Unity console.
public static void Log(string message)
Parameters
messagestringThe message to log.
LogError(string)
Logs an error message (red) to the Unity console.
public static void LogError(string message)
Parameters
messagestringThe 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
LogException(Exception)
Logs an exception to the Unity console, printing the stack trace.
public static void LogException(Exception exception)
Parameters
exceptionExceptionThe 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
LogWarning(string)
Logs a warning message (yellow) to the Unity console.
public static void LogWarning(string message)
Parameters
messagestringThe 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)