Class Log
A set of tools to print messages to the server console.
Inheritance
Inherited Members
Namespace: Exiled.API.Features
Assembly: Exiled.API.dll
Syntax
public static class Log
Properties
| Improve this Doc View SourceDebugEnabled
Gets a System.Collections.Generic.HashSet<T> of plugin assemblies that have debug logs enabled.
Declaration
public static HashSet<Assembly> DebugEnabled { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.Reflection.Assembly> |
Methods
| Improve this Doc View SourceAssert(Boolean, Object)
Sends an Error(Object) with the provided message if the condition is false and stops the execution.
results in it logging an error if the player is null and not continuing.
Player ply = Player.Get(2);
Log.Assert(ply is not null, "The player with the id 2 is null");
Declaration
public static void Assert(bool condition, object message)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | The conditional expression to evaluate. If the condition is true it will continue. |
System.Object | message | The information message. The error and exception will show this message. |
Exceptions
Type | Condition |
---|---|
System.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.
Declaration
public static void Debug(object message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | message | 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.
Declaration
public static void Debug(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | 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.
Declaration
public static T DebugObject<T>(T object)
Parameters
Type | Name | Description |
---|---|---|
T | object | The object to be logged and returned. |
Returns
Type | Description |
---|---|
T | Returns the |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static void Error(object message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | message | 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.
Declaration
public static void Error(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to be sent. |
Info(Object)
Sends a Discord.LogLevel.Info level messages to the game console.
Declaration
public static void Info(object message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | message | The message to be sent. |
Info(String)
Sends a Discord.LogLevel.Info level messages to the game console.
Declaration
public static void Info(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to be sent. |
Send(Object, LogLevel, ConsoleColor)
Sends a log message to the game console.
Declaration
public static void Send(object message, LogLevel level, ConsoleColor color = ConsoleColor.Gray)
Parameters
Type | Name | Description |
---|---|---|
System.Object | message | The message to be sent. |
Discord.LogLevel | level | The message level of importance. |
System.ConsoleColor | color | The message color. |
Send(String, LogLevel, ConsoleColor)
Sends a log message to the game console.
Declaration
public static void Send(string message, LogLevel level, ConsoleColor color = ConsoleColor.Gray)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to be sent. |
Discord.LogLevel | level | The message level of importance. |
System.ConsoleColor | color | The message color. |
SendRaw(Object, ConsoleColor)
Sends a raw log message to the game console.
Declaration
public static void SendRaw(object message, ConsoleColor color)
Parameters
Type | Name | Description |
---|---|---|
System.Object | message | The message to be sent. |
System.ConsoleColor | color | The System.ConsoleColor of the message. |
SendRaw(String, ConsoleColor)
Sends a raw log message to the game console.
Declaration
public static void SendRaw(string message, ConsoleColor color)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to be sent. |
System.ConsoleColor | color | The System.ConsoleColor of the message. |
Warn(Object)
Sends a Discord.LogLevel.Warn level messages to the game console.
Declaration
public static void Warn(object message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | message | The message to be sent. |
Warn(String)
Sends a Discord.LogLevel.Warn level messages to the game console.
Declaration
public static void Warn(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to be sent. |