Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Logging.NonLogger Class Reference

Logging implementation that does absolutely nothing More...

Inheritance diagram for Sphyrnidae.Common.Logging.NonLogger:
Sphyrnidae.Common.Logging.Interfaces.ILogger

Public Member Functions

void Generic (BaseLogInformation info, Action errorAction=null)
 
void Entry (TimerBaseInformation info, Action errorAction=null)
 
void Exit (TimerBaseInformation info, Action errorAction=null)
 
void Log (TraceEventType severity, string message, string category="")
 Logs a generic message More...
 
void Unauthorized (string message)
 Logs an unauthorized access to the system More...
 
TimerInformation TimerStart (string name)
 Will log how long the enclosed action took (from TimerStart to TimerEnd) More...
 
void TimerEnd (TimerInformation info)
 Logs the actual time an operation lasted (in milliseconds) More...
 
void Custom1< T > (T obj, string message="")
 Logs a generic object More...
 
void Custom2< T > (T obj, string message="")
 Logs a generic object More...
 
void Custom3< T > (T obj, string message="")
 Logs a generic object More...
 
CustomTimerInformation1< T1, T2 > CustomTimer1Start< T1, T2 > (T1 obj, string message="")
 Will log a custom timer object More...
 
CustomTimerInformation2< T1, T2 > CustomTimer2Start< T1, T2 > (T1 obj, string message="")
 Will log a custom timer object More...
 
CustomTimerInformation3< T1, T2 > CustomTimer3Start< T1, T2 > (T1 obj, string message="")
 Will log a custom timer object More...
 
void CustomTimerEnd< T1, T2 > (CustomTimerInformation< T1, T2 > info, T2 obj)
 Logs the actual time a custom timer took (in milliseconds) More...
 
AttributeInformation AttributeEntry (string attributeName, Dictionary< string, string > parameters)
 Will log an Attribute call More...
 
void AttributeExit (AttributeInformation info)
 Logs the actual time the attribute took (in milliseconds), as well as the result More...
 
Task< ApiInformationApiEntry ()
 Will log all configurable information about an API call More...
 
void ApiExit (ApiInformation info, int statusCode, string result)
 Logs the actual time API took (in milliseconds), as well as the result More...
 
Task ApiExit (ApiInformation info, HttpResponse response)
 Logs the actual time API took (in milliseconds), as well as the result More...
 
DatabaseInformation DatabaseEntry (string cnnName, string command, object args=null)
 Will log all configurable information about a database call More...
 
void DatabaseExit (DatabaseInformation info)
 Logs the actual time the database call took (in milliseconds) More...
 
WebServiceInformation WebServiceEntry (HttpHeaders headers, string name, string url, string method, object data=null)
 Will log all configurable information about a web service call More...
 
void WebServiceExit (WebServiceInformation info, int statusCode, string result)
 Logs the actual time the web service call took (in milliseconds), and optionally the result More...
 
Task WebServiceExit (WebServiceInformation info, HttpResponseMessage response)
 Logs the actual time the web service call took (in milliseconds), and optionally the result More...
 
MiddlewareInformation MiddlewareEntry (string name)
 Will log information about a middleware component More...
 
void MiddlewareExit (MiddlewareInformation info)
 Logs the actual time the middleware took (in milliseconds) More...
 
void HiddenException (Exception ex, bool messageOnly)
 Will log all hidden exception information More...
 
void HiddenException (Exception ex, string title="", bool messageOnly=true)
 Will log all hidden exception information More...
 
Guid Exception (Exception e, bool messageOnly)
 Will log all exception information More...
 
Guid Exception (Exception e, string title="", bool messageOnly=false)
 Will log all exception information More...
 

Detailed Description

Logging implementation that does absolutely nothing

Member Function Documentation

◆ ApiEntry()

Task<ApiInformation> Sphyrnidae.Common.Logging.NonLogger.ApiEntry ( )

Will log all configurable information about an API call

Call this method when first entering an API method The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/ApiInformation

Returns
The object which keeps the api information (to be passed into ApiExit)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ ApiExit() [1/2]

Task Sphyrnidae.Common.Logging.NonLogger.ApiExit ( ApiInformation  info,
HttpResponse  response 
)

Logs the actual time API took (in milliseconds), as well as the result

This should be called after ApiEntry

Parameters
infoThe object with the api information which was returned from ApiEntry
responseThe HttpResponse object

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ ApiExit() [2/2]

void Sphyrnidae.Common.Logging.NonLogger.ApiExit ( ApiInformation  info,
int  statusCode,
string  result 
)

Logs the actual time API took (in milliseconds), as well as the result

This should be called after ApiEntry

Parameters
infoThe object with the api information which was returned from ApiEntry
statusCodeThe http status code of the result
resultThe full http result

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ AttributeEntry()

AttributeInformation Sphyrnidae.Common.Logging.NonLogger.AttributeEntry ( string  attributeName,
Dictionary< string, string >  parameters 
)

Will log an Attribute call

Call this method when first entering an attribute

Parameters
attributeNameThe name of the attribute
parametersThe parameters into the attribute
Returns
The object which keeps the api information (to be passed into AttributeExit)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ AttributeExit()

void Sphyrnidae.Common.Logging.NonLogger.AttributeExit ( AttributeInformation  info)

Logs the actual time the attribute took (in milliseconds), as well as the result

This should be called after AttributeEntry

Parameters
infoThe object with the attribute information which was returned from AttributeEntry

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Custom1< T >()

void Sphyrnidae.Common.Logging.NonLogger.Custom1< T > ( obj,
string  message = "" 
)

Logs a generic object

To use this, you should create a class inheriting from CustomInformation1. Fill out all of the required abstract methods (and override any others) You will need to register this service: Eg. services.TryAddTransient<CustomInformation1<Widget>, WidgetInformation>(); When you call this method, the type needs to match... otherwise runtime exception with service locator.

Parameters
objYour object to be logged
messageOptional message to be logged (if not supplied in your inherited class)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Custom2< T >()

void Sphyrnidae.Common.Logging.NonLogger.Custom2< T > ( obj,
string  message = "" 
)

Logs a generic object

To use this, you should create a class inheriting from CustomInformation2. Fill out all of the required abstract methods (and override any others) You will need to register this service: Eg. services.TryAddTransient<CustomInformation2<Widget>, WidgetInformation>(); When you call this method, the type needs to match... otherwise runtime exception with service locator.

Parameters
objYour object to be logged
messageOptional message to be logged (if not supplied in your inherited class)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Custom3< T >()

void Sphyrnidae.Common.Logging.NonLogger.Custom3< T > ( obj,
string  message = "" 
)

Logs a generic object

To use this, you should create a class inheriting from CustomInformation3. Fill out all of the required abstract methods (and override any others) You will need to register this service: Eg. services.TryAddTransient<CustomInformation3<Widget>, WidgetInformation>(); When you call this method, the type needs to match... otherwise runtime exception with service locator.

Parameters
objYour object to be logged
messageOptional message to be logged (if not supplied in your inherited class)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ CustomTimer1Start< T1, T2 >()

CustomTimerInformation1<T1, T2> Sphyrnidae.Common.Logging.NonLogger.CustomTimer1Start< T1, T2 > ( T1  obj,
string  message = "" 
)

Will log a custom timer object

To use this, you should create a class inheriting from CustomTimerInformation1. Fill out all of the required abstract methods (and override any others) You will need to register this service: Eg. services.TryAddTransient<CustomTimerInformation1<Widget, Foo>, WidgetTimerInformation>(); When you call this method, the type needs to match... otherwise runtime exception with service locator.

Parameters
objYour object to be logged
messageOptional message to be logged (if not supplied in your inherited class)
Returns
The object which keeps the timer (to be passed into TimerEnd)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ CustomTimer2Start< T1, T2 >()

CustomTimerInformation2<T1, T2> Sphyrnidae.Common.Logging.NonLogger.CustomTimer2Start< T1, T2 > ( T1  obj,
string  message = "" 
)

Will log a custom timer object

To use this, you should create a class inheriting from CustomTimerInformation2. Fill out all of the required abstract methods (and override any others) You will need to register this service: Eg. services.TryAddTransient<CustomTimerInformation2<Widget, Foo>, WidgetTimerInformation>(); When you call this method, the type needs to match... otherwise runtime exception with service locator.

Parameters
objYour object to be logged
messageOptional message to be logged (if not supplied in your inherited class)
Returns
The object which keeps the timer (to be passed into TimerEnd)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ CustomTimer3Start< T1, T2 >()

CustomTimerInformation3<T1, T2> Sphyrnidae.Common.Logging.NonLogger.CustomTimer3Start< T1, T2 > ( T1  obj,
string  message = "" 
)

Will log a custom timer object

To use this, you should create a class inheriting from CustomTimerInformation3. Fill out all of the required abstract methods (and override any others) You will need to register this service: Eg. services.TryAddTransient<CustomTimerInformation3<Widget, Foo>, WidgetTimerInformation>(); When you call this method, the type needs to match... otherwise runtime exception with service locator.

Parameters
objYour object to be logged
messageOptional message to be logged (if not supplied in your inherited class)
Returns
The object which keeps the timer (to be passed into TimerEnd)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ CustomTimerEnd< T1, T2 >()

void Sphyrnidae.Common.Logging.NonLogger.CustomTimerEnd< T1, T2 > ( CustomTimerInformation< T1, T2 >  info,
T2  obj 
)

Logs the actual time a custom timer took (in milliseconds)

This should be called after CustomTimerStart

Parameters
infoThe object with the timer which was returned from CustomTimerStart
objAny object to store additional user-supplied information

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ DatabaseEntry()

DatabaseInformation Sphyrnidae.Common.Logging.NonLogger.DatabaseEntry ( string  cnnName,
string  command,
object  args = null 
)

Will log all configurable information about a database call

Call this method right before making a call to a database The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/DatabaseInformation

Parameters
cnnNameThe "nice" name for which database/connection you are using (don't include sensitive information)
commandThe command being executed
argsAny parameters for the command
Returns
The object which keeps the database information (to be passed into DatabaseExit)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ DatabaseExit()

void Sphyrnidae.Common.Logging.NonLogger.DatabaseExit ( DatabaseInformation  info)

Logs the actual time the database call took (in milliseconds)

This should be called after DatabaseEntry

Parameters
infoThe object with the database information which was returned from DatabaseEntry

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Entry()

void Sphyrnidae.Common.Logging.NonLogger.Entry ( TimerBaseInformation  info,
Action  errorAction = null 
)

◆ Exception() [1/2]

Guid Sphyrnidae.Common.Logging.NonLogger.Exception ( Exception  e,
bool  messageOnly 
)

Will log all exception information

Call this method whenever an exception has occurred that has stopped processing of the request The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/ExceptionInformation

Parameters
eThe exception that was thrown
messageOnlyOptional. Default = true If true, this will only log the exception text and type If false, all relevant information will be logged (eg. Stack Trace)
Returns
An identifier so the user can contact customer service

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Exception() [2/2]

Guid Sphyrnidae.Common.Logging.NonLogger.Exception ( Exception  e,
string  title = "",
bool  messageOnly = false 
)

Will log all exception information

Call this method whenever an exception has occurred that has stopped processing of the request The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/ExceptionInformation

Parameters
eThe exception that was thrown
titleThe type of exception, or a "nice" name you are giving this
messageOnlyOptional. Default = true If true, this will only log the exception text and type If false, all relevant information will be logged (eg. Stack Trace)
Returns
An identifier so the user can contact customer service

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Exit()

void Sphyrnidae.Common.Logging.NonLogger.Exit ( TimerBaseInformation  info,
Action  errorAction = null 
)

◆ Generic()

void Sphyrnidae.Common.Logging.NonLogger.Generic ( BaseLogInformation  info,
Action  errorAction = null 
)

◆ HiddenException() [1/2]

void Sphyrnidae.Common.Logging.NonLogger.HiddenException ( Exception  ex,
bool  messageOnly 
)

Will log all hidden exception information

Call this method whenever an exception has occurred that will be ignored The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/ExceptionInformation

Parameters
exThe exception that is being hidden
messageOnlyOptional. Default = true If true, this will only log the exception text and type If false, all relevant information will be logged (eg. Stack Trace)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ HiddenException() [2/2]

void Sphyrnidae.Common.Logging.NonLogger.HiddenException ( Exception  ex,
string  title = "",
bool  messageOnly = true 
)

Will log all hidden exception information

Call this method whenever an exception has occurred that will be ignored The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/ExceptionInformation

Parameters
exThe exception that is being hidden
titleThe type of exception, or a "nice" name you are giving this
messageOnlyOptional. Default = true If true, this will only log the exception text and type If false, all relevant information will be logged (eg. Stack Trace)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Log()

void Sphyrnidae.Common.Logging.NonLogger.Log ( TraceEventType  severity,
string  message,
string  category = "" 
)

Logs a generic message

Call this function at any place in your code where you want to capture helpful information

Parameters
severityThe severity level of the log request
messageThe message to log
categoryThe category of the message Default: "" (nothing)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ MiddlewareEntry()

MiddlewareInformation Sphyrnidae.Common.Logging.NonLogger.MiddlewareEntry ( string  name)

Will log information about a middleware component

Parameters
nameThe name of the middleware component
Returns
The object which keeps the middleware information (to be passed into MiddlewareExit)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ MiddlewareExit()

void Sphyrnidae.Common.Logging.NonLogger.MiddlewareExit ( MiddlewareInformation  info)

Logs the actual time the middleware took (in milliseconds)

Parameters
infoThe object with the middleware information which was returned from MiddlewareEntry

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ TimerEnd()

void Sphyrnidae.Common.Logging.NonLogger.TimerEnd ( TimerInformation  info)

Logs the actual time an operation lasted (in milliseconds)

This should be called after TimerStart

Parameters
infoThe object with the timer which was returned from TimerStart

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ TimerStart()

TimerInformation Sphyrnidae.Common.Logging.NonLogger.TimerStart ( string  name)

Will log how long the enclosed action took (from TimerStart to TimerEnd)

Call this function at any place in your code where you want to capture helpful timing information

Parameters
nameThe name you are giving this timer
Returns
The object which keeps the timer (to be passed into TimerEnd)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ Unauthorized()

void Sphyrnidae.Common.Logging.NonLogger.Unauthorized ( string  message)

Logs an unauthorized access to the system

This should be called on your authentication/authorization checks if they fail

Parameters
messageThe message to log

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ WebServiceEntry()

WebServiceInformation Sphyrnidae.Common.Logging.NonLogger.WebServiceEntry ( HttpHeaders  headers,
string  name,
string  url,
string  method,
object  data = null 
)

Will log all configurable information about a web service call

Call this method right before making a web service call The actual information that is collected (or if this even logs out) will be given by your implementation of ILoggerConfiguration/WebServiceInformation

Parameters
headersThe collection of HTTP headers that will have logger prefix added
nameThe unique name of the route you are hitting
urlThe endpoint that is being hit
methodThe HTTP method: GET POST PUT DELETE OTHER
dataAny additional data being sent in the body of the request
Returns
The object which keeps the web service information (to be passed into WebServiceExit)

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ WebServiceExit() [1/2]

Task Sphyrnidae.Common.Logging.NonLogger.WebServiceExit ( WebServiceInformation  info,
HttpResponseMessage  response 
)

Logs the actual time the web service call took (in milliseconds), and optionally the result

This should be called after WebServiceEntry

Parameters
infoThe object with the web service information which was returned from WebServiceEntry
responseThe result from the web service call

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.

◆ WebServiceExit() [2/2]

void Sphyrnidae.Common.Logging.NonLogger.WebServiceExit ( WebServiceInformation  info,
int  statusCode,
string  result 
)

Logs the actual time the web service call took (in milliseconds), and optionally the result

This should be called after WebServiceEntry

Parameters
infoThe object with the web service information which was returned from WebServiceEntry
statusCodeThe http status code of the result
resultThe full http result

Implements Sphyrnidae.Common.Logging.Interfaces.ILogger.


The documentation for this class was generated from the following file: