Class LunyLogger
- Namespace
- Luny
- Assembly
- Luny.dll
Engine-agnostic logger entry point. Delegates to an installable engine-specific logger. Default fallback logs to console until an engine replaces it. Also provides internal logging system for Luny-specific logs (opt-in).
public static class LunyLogger
- Inheritance
-
objectLunyLogger
Properties
EnableInternalLogging
Enables internal Luny logging system. When enabled, all log messages are recorded in an internal list with frame/time information. Useful for in-game console, file logging, etc.
public static bool EnableInternalLogging { get; set; }
Property Value
- bool
Logger
Installs an engine-specific logger. Pass null to revert to the default console logger.
public static ILunyLogger Logger { get; set; }
Property Value
Methods
ClearInternalLog()
Clears all internal log entries.
public static void ClearInternalLog()
GetInternalLog()
Gets the internal log entries. Returns empty array if EnableInternalLogging is false or no logs recorded.
public static IReadOnlyList<LogEntry> GetInternalLog()
Returns
- IReadOnlyList<LogEntry>
LogError(object, object)
public static void LogError(object obj, object context = null)
Parameters
objobjectcontextobject
LogError(string, object)
public static void LogError(string message, object context = null)
Parameters
messagestringcontextobject
LogException(Exception, object)
public static void LogException(Exception exception, object context = null)
Parameters
exceptionExceptioncontextobject
LogInfo(object, object)
public static void LogInfo(object obj, object context = null)
Parameters
objobjectcontextobject
LogInfo(string, object)
public static void LogInfo(string message, object context = null)
Parameters
messagestringcontextobject
LogWarning(object, object)
public static void LogWarning(object obj, object context = null)
Parameters
objobjectcontextobject
LogWarning(string, object)
public static void LogWarning(string message, object context = null)
Parameters
messagestringcontextobject
WriteInternalLogToFile(string)
Writes the internal log to a file. Format: [FrameXXXXXXXX] [Time] [Level] [Context] Message
public static void WriteInternalLogToFile(string path)
Parameters
pathstring