Table of Contents

Class Log

Namespace
Exiled.API.Features
Assembly
Exiled.API.dll

A set of tools to print messages to the server console.

public static class Log
Inheritance
Log
Inherited Members

Properties

DebugEnabled

Gets a HashSet<T> of plugin assemblies that have debug logs enabled.

public static HashSet<Assembly> DebugEnabled { get; }

Property Value

HashSet<Assembly>

Methods

Assert(bool, object)

Sends an Error(object) with the provided message if the condition is false and stops the execution. For example:

Player ply = Player.Get(2);
Log.Assert(ply is not null, "The player with the id 2 is null");

results in it logging an error if the player is null and not continuing.

public static void Assert(bool condition, object message)

Parameters

condition bool

The conditional expression to evaluate. If the condition is true it will continue.

message object

The information message. The error and exception will show this message.

Exceptions

Exception

If the condition is false. It throws an exception stopping the execution.

Debug(object)

Sends a Discord.LogLevel.Debug level messages to the game console. Server must have exiled_debug config enabled.

public static void Debug(object message)

Parameters

message object

The message to be sent.

Debug(string)

Sends a Discord.LogLevel.Debug level messages to the game console. Server must have exiled_debug config enabled.

public static void Debug(string message)

Parameters

message string

The message to be sent.

DebugObject<T>(T)

Sends a Discord.LogLevel.Debug level messages to the game console. Server must have exiled_debug config enabled.

public static T DebugObject<T>(T @object)

Parameters

object T

The object to be logged and returned.

Returns

T

Returns the T object inputted in object.

Type Parameters

T

The inputted object's type.

Error(object)

Sends a Discord.LogLevel.Error level messages to the game console. This should be used to send errors only. It's recommended to send any messages in the catch block of a try/catch as errors with the exception string.

public static void Error(object message)

Parameters

message object

The message to be sent.

Error(string)

Sends a Discord.LogLevel.Error level messages to the game console. This should be used to send errors only. It's recommended to send any messages in the catch block of a try/catch as errors with the exception string.

public static void Error(string message)

Parameters

message string

The message to be sent.

Info(object)

Sends a Discord.LogLevel.Info level messages to the game console.

public static void Info(object message)

Parameters

message object

The message to be sent.

Info(string)

Sends a Discord.LogLevel.Info level messages to the game console.

public static void Info(string message)

Parameters

message string

The message to be sent.

Send(object, LogLevel, ConsoleColor)

Sends a log message to the game console.

public static void Send(object message, LogLevel level, ConsoleColor color = ConsoleColor.Gray)

Parameters

message object

The message to be sent.

level LogLevel

The message level of importance.

color ConsoleColor

The message color.

Send(string, LogLevel, ConsoleColor)

Sends a log message to the game console.

public static void Send(string message, LogLevel level, ConsoleColor color = ConsoleColor.Gray)

Parameters

message string

The message to be sent.

level LogLevel

The message level of importance.

color ConsoleColor

The message color.

SendRaw(object, ConsoleColor)

Sends a raw log message to the game console.

public static void SendRaw(object message, ConsoleColor color)

Parameters

message object

The message to be sent.

color ConsoleColor

The ConsoleColor of the message.

SendRaw(string, ConsoleColor)

Sends a raw log message to the game console.

public static void SendRaw(string message, ConsoleColor color)

Parameters

message string

The message to be sent.

color ConsoleColor

The ConsoleColor of the message.

Warn(object)

Sends a Discord.LogLevel.Warn level messages to the game console.

public static void Warn(object message)

Parameters

message object

The message to be sent.

Warn(string)

Sends a Discord.LogLevel.Warn level messages to the game console.

public static void Warn(string message)

Parameters

message string

The message to be sent.