IJoaLogger
Namespace: JoaLauncher.Api.Injectables
Can be used to log to the joalog.log file
public interface IJoaLogger
Methods
void Log(string message, LogLevel logLevel)
Logs the message with the provided LogLevel
Parameters
Name | Description |
---|---|
System.String message | The message to be logged |
JoaLauncher.Api.Injectables.LogLevel logLevel | The LogLevel that should be used |
void Info(string message)
Logs a message with LogLevel.Info
Parameters
Name | Description |
---|---|
System.String message | The message to be logged |
void Warning(string message)
Logs a message with LogLevel.Warning
Parameters
Name | Description |
---|---|
System.String message | The message to be logged |
void Error(string message)
Logs a message with LogLevel.Error
Parameters
Name | Description |
---|---|
System.String message | The message to be logged |
IDisposable TimedOperation(string nameOfMethod)
Can be used to time an operatio The messurement will be stoped and logged if the returned IDisposable gets disposed <example> using var _ = _log.TimedOperation(nameof(SomeMethod)); </example>
Parameters
Name | Description |
---|---|
System.String nameOfMethod | The name of the operation to be logged |
Returns
Type | Description |
---|---|
System.IDisposable | An IDisposable which will trigger the logging if disposed |
void LogException(Exception e, string logName = "")
Parameters
Name | Description |
---|---|
System.Exception e | |
System.String logName |