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
- severityLogSeverity
- The severity of the event. 
- sourcestring
- The source of the event. 
- messagestring
- The message of the event. 
- exceptionException
- The exception of the event. 
Properties
Exception
Gets the exception of this log entry.
public readonly Exception Exception { get; }Property Value
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
- builderStringBuilder
- fullExceptionbool
- prependTimestampbool
- timestampKindDateTimeKind
- padSourceint?