Table of Contents

Struct LogMessage

Namespace
Discord
Assembly
Discord.Net.Core.dll

Provides a message object used for logging purposes.

public struct LogMessage
Inherited Members

Constructors

LogMessage(LogSeverity, string, string, Exception)

Initializes a new LogMessage struct with the severity, source, message of the event, and optionally, an exception.

public LogMessage(LogSeverity severity, string source, string message, Exception exception = null)

Parameters

severity LogSeverity

The severity of the event.

source string

The source of the event.

message string

The message of the event.

exception Exception

The exception of the event.

Properties

Exception

Gets the exception of this log entry.

public readonly Exception Exception { get; }

Property Value

Exception

An Exception object associated with an incident; otherwise null.

Message

Gets the message of this log entry.

public readonly string Message { get; }

Property Value

string

A string containing the message of this log entry.

Severity

Gets the severity of the log entry.

public readonly LogSeverity Severity { get; }

Property Value

LogSeverity

A LogSeverity enum to indicate the severeness of the incident or event.

Source

Gets the source of the log entry.

public readonly string Source { get; }

Property Value

string

A string representing the source of the log entry.

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(StringBuilder, bool, bool, DateTimeKind, int?)

public string ToString(StringBuilder builder = null, bool fullException = true, bool prependTimestamp = true, DateTimeKind timestampKind = DateTimeKind.Local, int? padSource = 11)

Parameters

builder StringBuilder
fullException bool
prependTimestamp bool
timestampKind DateTimeKind
padSource int?

Returns

string