Table of Contents

Class LoggerBase

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Base implementation for ILogger which implements all methods besides a new abstract method LogImpl(EnumLogType, string, params object[]).

public abstract class LoggerBase : ILogger
Inheritance
LoggerBase
Implements
Inherited Members
Extension Methods

Fields

SourcePath

public static string SourcePath

Field Value

string

Properties

TraceLog

If true, will also print to Diagnostics.Debug.

public bool TraceLog { get; set; }

Property Value

bool

Methods

Audit(string)

Adds a new Audit log entry with the specified message.

public void Audit(string message)

Parameters

message string

Audit(string, params object[])

Adds a new Audit log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Build(string)

Adds a new Build log entry with the specified message.

public void Build(string message)

Parameters

message string

Build(string, params object[])

Adds a new Build log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Chat(string)

Adds a new Chat log entry with the specified message.

public void Chat(string message)

Parameters

message string

Chat(string, params object[])

Adds a new Chat log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

CleanStackTrace(string)

Remove the full path from the stacktrace of the machine that compiled the code

public static string CleanStackTrace(string stackTrace)

Parameters

stackTrace string

Returns

string

ClearWatchers()

Removes any handler that registered to the EntryAdded event. This method is called when the client leaves a world or server shuts down.

public void ClearWatchers()

Debug(string)

Adds a new Debug log entry with the specified message.

public void Debug(string message)

Parameters

message string

Debug(string, params object[])

Adds a new Debug log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Error(Exception)

Convenience method for logging exceptions in try/catch blocks

public void Error(Exception e)

Parameters

e Exception

Error(string)

Adds a new Error log entry with the specified message.

public void Error(string message)

Parameters

message string

Error(string, params object[])

Adds a new Error log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Event(string)

Adds a new Event log entry with the specified message.

public void Event(string message)

Parameters

message string

Event(string, params object[])

Adds a new Event log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Fatal(Exception)

Convenience method for logging exceptions in try/catch blocks

public void Fatal(Exception e)

Parameters

e Exception

Fatal(string)

Adds a new Fatal log entry with the specified message.

public void Fatal(string message)

Parameters

message string

Fatal(string, params object[])

Adds a new Fatal log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Log(EnumLogType, string)

Adds a new log entry with the specified log type and message.

public void Log(EnumLogType logType, string message)

Parameters

logType EnumLogType
message string

Log(EnumLogType, string, params object[])

Adds a new log entry with the specified log type, format string and arguments.

public void Log(EnumLogType logType, string format, params object[] args)

Parameters

logType EnumLogType
format string
args object[]

LogImpl(EnumLogType, string, params object[])

This is the only method necessary to be overridden by the implementing class, actually does the logging as necessary.

protected abstract void LogImpl(EnumLogType logType, string format, params object[] args)

Parameters

logType EnumLogType
format string
args object[]

Notification(string)

Adds a new Notification log entry with the specified message.

public void Notification(string message)

Parameters

message string

Notification(string, params object[])

Adds a new Notification log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

StoryEvent(string)

Adds a new StoryEvent log entry with the specified message.

public void StoryEvent(string message)

Parameters

message string

StoryEvent(string, params object[])

Adds a new StoryEvent log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

VerboseDebug(string)

Adds a new VerboseDebug log entry with the specified message.

public void VerboseDebug(string message)

Parameters

message string

VerboseDebug(string, params object[])

Adds a new VerboseDebug log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Warning(Exception)

Convenience method for logging exceptions in try/catch blocks

public void Warning(Exception e)

Parameters

e Exception

Warning(string)

Adds a new Warning log entry with the specified message.

public void Warning(string message)

Parameters

message string

Warning(string, params object[])

Adds a new Warning log entry with the specified format string and arguments.

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

Parameters

format string
args object[]

Worldgen(Exception)

public void Worldgen(Exception e)

Parameters

e Exception

Worldgen(string)

public void Worldgen(string message)

Parameters

message string

Worldgen(string, params object[])

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

Parameters

format string
args object[]

Events

EntryAdded

Fired each time a new log entry has been added.

public event LogEntryDelegate EntryAdded

Event Type

LogEntryDelegate