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

Extension methods for loggers that allow the easy creation of loggers that log records in the scope of generic type and method name. More...

Static Public Member Functions

static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, [CallerMemberName]string methodName=null)
 Creates a new logger for the generic types scope and a method name.
 
static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, LogLevel level, string startMessage, [CallerMemberName]string methodName=null, string endMessage=null)
 Creates a new logger for the generic types scope and a method name.
 
static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, LogLevel level, string startMessage, Map< string, object > parameters, [CallerMemberName]string methodName=null, string endMessage=null)
 Creates a new logger for the generic types scope and a method name.
 
static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, LogLevel level, string startMessage, object parameter, [CallerMemberName]string methodName=null, string endMessage=null)
 Creates a new logger for the generic types scope and a method name.
 
static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, LogLevel level, string startMessage, object[] parameters, [CallerMemberName]string methodName=null, string endMessage=null)
 Creates a new logger for the generic types scope and a method name.
 
static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, LogLevel level, string startMessage, IEnumerable listParameter, [CallerMemberName]string methodName=null, string endMessage=null)
 Creates a new logger for the generic types scope and a method name.
 
static Logger< NewSourceType > StartNewMethodScope< NewSourceType > (this Logger logger, LogRecord startRecord, [CallerMemberName]string methodName=null, LogRecord endRecord=null)
 Creates a new logger for the generic types scope and a method name.
 

Detailed Description

Extension methods for loggers that allow the easy creation of loggers that log records in the scope of generic type and method name.

Since
Unreleased

Member Function Documentation

◆ StartNewMethodScope< NewSourceType >() [1/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
[CallerMemberName] string  methodName = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
Returns
a logger that that logs records with the method scope

◆ StartNewMethodScope< NewSourceType >() [2/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
LogLevel  level,
string  startMessage,
[CallerMemberName] string  methodName = null,
string  endMessage = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that that logs records with the method scope

◆ StartNewMethodScope< NewSourceType >() [3/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
LogLevel  level,
string  startMessage,
IEnumerable  listParameter,
[CallerMemberName] string  methodName = null,
string  endMessage = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
levelthe log level of the start and end message
startMessagethe message to write when the scope starts
listParameterthe list parameter to use in the startMessage
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that that logs records with the method scope

◆ StartNewMethodScope< NewSourceType >() [4/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
LogLevel  level,
string  startMessage,
Map< string, object >  parameters,
[CallerMemberName] string  methodName = null,
string  endMessage = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
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
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that that logs records with the method scope

◆ StartNewMethodScope< NewSourceType >() [5/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
LogLevel  level,
string  startMessage,
object  parameter,
[CallerMemberName] string  methodName = null,
string  endMessage = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
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
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that that logs records with the method scope

◆ StartNewMethodScope< NewSourceType >() [6/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
LogLevel  level,
string  startMessage,
object[]  parameters,
[CallerMemberName] string  methodName = null,
string  endMessage = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
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
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
endMessagethe message to write when the scope ends and the new logger is disposed
Returns
a logger that that logs records with the method scope

◆ StartNewMethodScope< NewSourceType >() [7/7]

static Logger< NewSourceType > Joutsen.Logging.LoggerMethodScopeExtensions.StartNewMethodScope< NewSourceType > ( this Logger  logger,
LogRecord  startRecord,
[CallerMemberName] string  methodName = null,
LogRecord  endRecord = null 
)
static

Creates a new logger for the generic types scope and a method name.

Parameters
loggerthe logger to call this mehtod on
startRecordthe record to write when the scope starts
methodNamethe name of the method that defines the scope. If not provided the compiler will fill in the calling methods name.
endRecordthe record to write when the scope ends and the logger is disposed
Returns
a logger that that logs records with the method scope