Table of Contents

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
object
LunyLogger

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

ILunyLogger

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

obj object
context object

LogError(string, object)

public static void LogError(string message, object context = null)

Parameters

message string
context object

LogException(Exception, object)

public static void LogException(Exception exception, object context = null)

Parameters

exception Exception
context object

LogInfo(object, object)

public static void LogInfo(object obj, object context = null)

Parameters

obj object
context object

LogInfo(string, object)

public static void LogInfo(string message, object context = null)

Parameters

message string
context object

LogWarning(object, object)

public static void LogWarning(object obj, object context = null)

Parameters

obj object
context object

LogWarning(string, object)

public static void LogWarning(string message, object context = null)

Parameters

message string
context object

WriteInternalLogToFile(string)

Writes the internal log to a file. Format: [FrameXXXXXXXX] [Time] [Level] [Context] Message

public static void WriteInternalLogToFile(string path)

Parameters

path string