Joutsen Logging v0.5.0+26-g72240ac
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Joutsen.Logging.LoggerNewScopeExtensions Class Reference

Extension methods for loggers that allow the easy creation of new scopes. More...

Static Public Member Functions

static Logger StartNewScope (this Logger logger, Scope scope)
 Creates a new scoped logger for a predifined scope.
 
static Logger StartNewScope (this Logger logger, Scope scope, LogLevel level, string startMessage, string endMessage=null)
 Creates a new scoped logger for a predifined scope that writes a specific start and end message.
 
static Logger StartNewScope (this Logger logger, Scope scope, LogLevel level, string startMessage, object[] parameters, string endMessage=null)
 Creates a new scoped logger for a predifined scope that writes a specific start and end message.
 
static Logger StartNewScope (this Logger logger, Scope scope, LogLevel level, string startMessage, Map< string, object > parameters, string endMessage=null)
 Creates a new scoped logger for a predifined scope that writes a specific start and end message.
 
static Logger StartNewScope (this Logger logger, Scope scope, LogLevel level, string startMessage, object parameter, string endMessage=null)
 Creates a new scoped logger for a predifined scope that writes a specific start and end message.
 
static Logger StartNewScope (this Logger logger, Scope scope, LogLevel level, string startMessage, IEnumerable listParameter, string endMessage=null)
 Creates a new scoped logger for a predifined scope that writes a specific start and end message.
 
static Logger StartNewScope (this Logger logger, Scope scope, LogRecord startRecord, LogRecord endRecord=null)
 Creates a new scoped logger for a predifined scope that writes a specific start and end message.
 

Detailed Description

Extension methods for loggers that allow the easy creation of new scopes.

Since
Unreleased

Member Function Documentation

◆ StartNewScope() [1/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope 
)
static

Creates a new scoped logger for a predifined scope.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
Returns
a logger that handles logging of records inthe new scope

◆ StartNewScope() [2/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope,
LogLevel  level,
string  startMessage,
IEnumerable  listParameter,
string  endMessage = null 
)
static

Creates a new scoped logger for a predifined scope that writes a specific start and end message.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
listParameterthe list parameter object to use in the startMessage
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that handles logging of records inthe new scope

◆ StartNewScope() [3/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope,
LogLevel  level,
string  startMessage,
Map< string, object >  parameters,
string  endMessage = null 
)
static

Creates a new scoped logger for a predifined scope that writes a specific start and end message.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
parametersthe named parameters to use in the startMessage
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that handles logging of records inthe new scope

◆ StartNewScope() [4/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope,
LogLevel  level,
string  startMessage,
object  parameter,
string  endMessage = null 
)
static

Creates a new scoped logger for a predifined scope that writes a specific start and end message.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
parameterthe parameter object to use in the startMessage
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that handles logging of records inthe new scope

◆ StartNewScope() [5/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope,
LogLevel  level,
string  startMessage,
object[]  parameters,
string  endMessage = null 
)
static

Creates a new scoped logger for a predifined scope that writes a specific start and end message.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
parametersthe positional parameters to use in the startMessage
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that handles logging of records inthe new scope

◆ StartNewScope() [6/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope,
LogLevel  level,
string  startMessage,
string  endMessage = null 
)
static

Creates a new scoped logger for a predifined scope that writes a specific start and end message.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that handles logging of records inthe new scope

◆ StartNewScope() [7/7]

static Logger Joutsen.Logging.LoggerNewScopeExtensions.StartNewScope ( this Logger  logger,
Scope  scope,
LogRecord  startRecord,
LogRecord  endRecord = null 
)
static

Creates a new scoped logger for a predifined scope that writes a specific start and end message.

Parameters
loggerthe logger to call this mehtod on
scopethe new scope
startRecordthe record to write when the scope starts
endRecordthe record to write when the scope ends and the logger is disposed
Returns
a logger that handles logging of records inthe new scope