Skip to content

API Reference

Thev2Andy edited this page Jan 20, 2022 · 11 revisions

Logger Class API

The class used for writing logs.

• Methods

Log Method

• Definition

Calls a log, sent over to the OnLog event.

public static void Log(string, LogType, bool, bool, bool, object)

• Parameters

LogMessage String

The message of the log.


MessageType LogType

The type of the log.


SaveLogToFile Bool

Save this specific log to the log file?


Timestamp Bool

Timestamp this log in the file?


TriggerLogEvent Bool

Trigger the OnLog event?


LogSender Object

The sender of the log. (Only used when passing the reference to LogEventArgs)


SaveLog Method

• Definition

Saves logs in a file.

public static void SaveLog(object, EventArgs)

ClearLog Method

• Definition

Saves logs in a file.

public static void ClearLog(bool, bool)

• Parameters

DeleteFile Bool

Delete the log file?


InvokeClearEvent Bool

Invoke the OnClear event?



• Fields / Properties

OnLog EventHandler<LogEventArgs>

public static event EventHandler<LogEventArgs> OnLog;

Invoked on Log() call.


OnClear EventHandler<EventArgs>

public static event EventHandler<LogEventArgs> OnClear;

Invoked on ClearLog() call.



LogSession Class API

Holds information regarding the current logging session.

• Methods

Initialize Method

• Definition

Initializes the LogSession, Logger and the cache cleaner.

public static void Initialize()

ClearCache Method

• Definition

Clears the log cache, releasing memory and saving the cached logs in the log file.

public static void ClearCache()


• Fields / Properties

Initialized Bool

public static bool Initialized { get; internal set; }

Toggle writing logs to a file, stored next to the caller assembly.


LogCache String

public static string LogCache {get; internal set;}

Stores all logs called since last clear/autoclear.

LogExceptions Bool

public static bool LogExceptions = true;

Enable auto-logging of unhandled exceptions?


LogPath String

public static string LogPath;

The path to the log file. (Bug Potential!)


AutoCacheClear Bool

public static bool AutoCacheClear = true;

Is the log session clearing the log cache? (Unless manually cleared, disabling this will cause memory leaks in managed code.)


CacheClearInterval Float

public static float CacheClearInterval {get; private set;}

The interval between cache clear calls.


LoggingStripped Bool

public static bool LoggingStripped {get; private set;}

Is the "-nolog" launch parameter active?



LogEventArgs Class API

Log Event Arguments holder.

• Fields / Properties

LogMessage String

• Definition

The message of the log.

public string LogMessage;

MessageType LogType

• Definition

The type of the log.

public LogType MessageType;

LogTime DateTime

• Definition

The time the log was sent at.

public DateTime LogTime;

Timestamped Bool

• Definition

Is the log timestamped?

public bool Timestamped;

LogSender Object

• Definition

The sender of the log.

public object LogSender;


LogType Enum

Log type enumeration.

• Fields / Properties

Info


Warning


Error


Network


Fatal


Null

Clone this wiki locally