Joutsen Logging v0.5.0+22-gec3d058
Public Member Functions | Static Public Member Functions | Properties | List of all members
Joutsen.Logging.LogRecord Class Reference

A class that represents the information of a single log entry. More...

Public Member Functions

 LogRecord ()
 Creates an instance for the default log level info. More...
 
 LogRecord (LogLevel level)
 Creates an instance for a log level. More...
 
override bool Equals (object obj)
 
override string ToString ()
 
override int GetHashCode ()
 

Static Public Member Functions

static LogRecord Create (LogLevel level, string message, object[] parameters)
 
static LogRecord Create (LogLevel level, string message, Map< string, object > parameters)
 
static LogRecord Create (LogLevel level, string message, object parameter)
 
static LogRecord Create (LogLevel level, string message, IEnumerable parameters)
 

Properties

virtual DateTime TimeStamp [get]
 The point in time where this record was created in UTC. More...
 
virtual Guid Id [get]
 
virtual String Message [get, set]
 The log message. More...
 
virtual String UnformattedMessage [get, set]
 The message as it was added to the record. More...
 
virtual Exception Error [get, set]
 Exception information. More...
 
virtual Map< string, object > NamedParameters [get, set]
 The parameters to format the message. More...
 
virtual object[] PositionalParameters [get, set]
 The parameters to format the message. More...
 
virtual object ParametersObject [get, set]
 The parameter object to format the message. More...
 
virtual LogLevel Level [get]
 The log level of the new record. More...
 
virtual IEnumerable ListParameter [get, set]
 A list parameter to format the message. More...
 
Scope Scope [get, set]
 The scope this record belongs to. More...
 
virtual String StackTrace [get]
 The StackTrace of the exception if one is available. More...
 
virtual String ErrorMessage [get]
 The message of the exception if one is available. More...
 
virtual Type ErrorType [get]
 The type of the exception if one is available. More...
 

Detailed Description

A class that represents the information of a single log entry.

Since
0.2.0

Constructor & Destructor Documentation

◆ LogRecord() [1/2]

Joutsen.Logging.LogRecord.LogRecord ( )

Creates an instance for the default log level info.

◆ LogRecord() [2/2]

Joutsen.Logging.LogRecord.LogRecord ( LogLevel  level)

Creates an instance for a log level.

Parameters
levelthe log level of the new record

Member Function Documentation

◆ Create() [1/4]

static LogRecord Joutsen.Logging.LogRecord.Create ( LogLevel  level,
string  message,
IEnumerable  parameters 
)
static

◆ Create() [2/4]

static LogRecord Joutsen.Logging.LogRecord.Create ( LogLevel  level,
string  message,
Map< string, object >  parameters 
)
static

◆ Create() [3/4]

static LogRecord Joutsen.Logging.LogRecord.Create ( LogLevel  level,
string  message,
object  parameter 
)
static

◆ Create() [4/4]

static LogRecord Joutsen.Logging.LogRecord.Create ( LogLevel  level,
string  message,
object[]  parameters 
)
static

◆ Equals()

override bool Joutsen.Logging.LogRecord.Equals ( object  obj)

◆ GetHashCode()

override int Joutsen.Logging.LogRecord.GetHashCode ( )

◆ ToString()

override string Joutsen.Logging.LogRecord.ToString ( )

Property Documentation

◆ Error

virtual Exception Joutsen.Logging.LogRecord.Error
getset

Exception information.

◆ ErrorMessage

virtual String Joutsen.Logging.LogRecord.ErrorMessage
get

The message of the exception if one is available.

Since
0.4.0

◆ ErrorType

virtual Type Joutsen.Logging.LogRecord.ErrorType
get

The type of the exception if one is available.

Since
0.4.0

◆ Id

virtual Guid Joutsen.Logging.LogRecord.Id
get

◆ Level

virtual LogLevel Joutsen.Logging.LogRecord.Level
get

The log level of the new record.

◆ ListParameter

virtual IEnumerable Joutsen.Logging.LogRecord.ListParameter
getset

A list parameter to format the message.

This parameter will be inserted into the message where either {listParameter} is used as a name or as an additional positional parameter.

Remarks
The list parameter is intended to log out a string representation of a list's item. Each item's System.Object.ToString method will be used to create the output instead of the list's.
Since
0.3.0

◆ Message

virtual String Joutsen.Logging.LogRecord.Message
getset

The log message.

Remarks
When setting the log message can contain formatting information like placeholders for parameter values referenced by name or index respectively and references to properties of the log record. These will be replaced with the referenced values when the message is fetched. To get the unformatted message use UnformattedMessage.

◆ NamedParameters

virtual Map<string,object> Joutsen.Logging.LogRecord.NamedParameters
getset

The parameters to format the message.

These parameter values will be inserted into the message by their name if they are referenced.

◆ ParametersObject

virtual object Joutsen.Logging.LogRecord.ParametersObject
getset

The parameter object to format the message.

The properties of the object will be inserted into the message by their name if they are referenced.

◆ PositionalParameters

virtual object [] Joutsen.Logging.LogRecord.PositionalParameters
getset

The parameters to format the message.

These parameter values will be inserted into the message by their index if they are referenced.

◆ Scope

Scope Joutsen.Logging.LogRecord.Scope
getset

The scope this record belongs to.

Since
Unreleased

◆ StackTrace

virtual String Joutsen.Logging.LogRecord.StackTrace
get

The StackTrace of the exception if one is available.

Since
0.4.0

◆ TimeStamp

virtual DateTime Joutsen.Logging.LogRecord.TimeStamp
get

The point in time where this record was created in UTC.

◆ UnformattedMessage

virtual String Joutsen.Logging.LogRecord.UnformattedMessage
getset

The message as it was added to the record.

Since
0.4.0