Class ActionLogger
- Namespace
- Splat
- Assembly
- Splat.dll
A logger where you pass in Action delegates that will be invoked when the Write methods are invoked.
public class ActionLogger : ILogger
- Inheritance
-
ActionLogger
- Implements
- Extension Methods
Remarks
Initializes a new instance of the ActionLogger class.
Constructors
ActionLogger(Action<string, LogLevel>, Action<string, Type, LogLevel>, Action<Exception, string, LogLevel>, Action<Exception, string, Type, LogLevel>)
A logger where you pass in Action delegates that will be invoked when the Write methods are invoked.
public ActionLogger(Action<string, LogLevel> writeNoType, Action<string, Type, LogLevel> writeWithType, Action<Exception, string, LogLevel> writeNoTypeWithException, Action<Exception, string, Type, LogLevel> writeWithTypeAndException)
Parameters
writeNoType
Action<string, LogLevel>A action which is called when the Write(string, LogLevel) is called.
writeWithType
Action<string, Type, LogLevel>A action which is called when the Write(string, Type, LogLevel) is called.
writeNoTypeWithException
Action<Exception, string, LogLevel>A action which is called when the Write(Exception, string, LogLevel) is called.
writeWithTypeAndException
Action<Exception, string, Type, LogLevel>A action which is called when the Write(Exception, string, Type, LogLevel) is called.
Remarks
Initializes a new instance of the ActionLogger class.
Properties
Level
Gets the level at which the target will emit messages.
public LogLevel Level { get; set; }
Property Value
Methods
Write(Exception, string, LogLevel)
Writes a message to the target.
public void Write(Exception exception, string message, LogLevel logLevel)
Parameters
exception
ExceptionThe exception that occured.
message
stringThe message to write.
logLevel
LogLevelThe severity level of the log message.
Write(Exception, string, Type, LogLevel)
Writes a message to the target.
public void Write(Exception exception, string message, Type type, LogLevel logLevel)
Parameters
exception
ExceptionThe exception that occured.
message
stringThe message.
type
TypeThe type.
logLevel
LogLevelThe log level.
Write(string, LogLevel)
Writes a message to the target.
public void Write(string message, LogLevel logLevel)
Parameters
Write(string, Type, LogLevel)
Writes a message to the target.
public void Write(string message, Type type, LogLevel logLevel)