#nullable enable
using System;
namespace Swan {
///
/// Event arguments representing the message that is logged
/// on to the terminal. Use the properties to forward the data to
/// your logger of choice.
///
///
// [Obsolete("NEED", false)]
public class LogMessageReceivedEventArgs : EventArgs {
///
/// Initializes a new instance of the class.
///
/// The sequence.
/// Type of the message.
/// The UTC date.
/// The source.
/// The message.
/// The extended data.
/// Name of the caller member.
/// The caller file path.
/// The caller line number.
public LogMessageReceivedEventArgs(UInt64 sequence, LogLevel messageType, DateTime utcDate, String source, String message, Object? extendedData, String callerMemberName, String callerFilePath, Int32 callerLineNumber) {
this.Sequence = sequence;
this.MessageType = messageType;
this.UtcDate = utcDate;
this.Source = source;
this.Message = message;
this.CallerMemberName = callerMemberName;
this.CallerFilePath = callerFilePath;
this.CallerLineNumber = callerLineNumber;
this.ExtendedData = extendedData;
}
///
/// Gets logging message sequence.
///
///
/// The sequence.
///
public UInt64 Sequence {
get;
}
///
/// Gets the type of the message.
/// It can be a combination as the enumeration is a set of bitwise flags.
///
///
/// The type of the message.
///
public LogLevel MessageType {
get;
}
///
/// Gets the UTC date at which the event at which the message was logged.
///
///
/// The UTC date.
///
public DateTime UtcDate {
get;
}
///
/// Gets the name of the source where the logging message
/// came from. This can come empty if the logger did not set it.
///
///
/// The source.
///
public String Source {
get;
}
///
/// Gets the body of the message.
///
///
/// The message.
///
public String Message {
get;
}
///
/// Gets the name of the caller member.
///
///
/// The name of the caller member.
///
public String CallerMemberName {
get;
}
///
/// Gets the caller file path.
///
///
/// The caller file path.
///
public String CallerFilePath {
get;
}
///
/// Gets the caller line number.
///
///
/// The caller line number.
///
public Int32 CallerLineNumber {
get;
}
///
/// Gets an object representing extended data.
/// It could be an exception or anything else.
///
///
/// The extended data.
///
public Object? ExtendedData {
get;
}
///
/// Gets the Extended Data properties cast as an Exception (if possible)
/// Otherwise, it return null.
///
///
/// The exception.
///
public Exception? Exception => this.ExtendedData as Exception;
}
}