Logging abstraction for .NET Core
public abstract class BaseLogger : Samhammer.Logging.BaseLogger, ILog
public class NLogLogger : BaseLogger
{
...
public override void Log(string message, string logType, Samhammer.Logging.LogDetails details, Samhammer.Logging.LogLevel loglevel, Exception ex, string memberName, string sourceFilePath,
int sourceLineNumber)
{
...
}
}
Create a class that inherits from this packages BaseLogger and implements the log method. This method needs to either call some other logging framework, or directly output the log.
Logger.Init(() => new SerilogLogger(), fallbackLogType);
ILog log = Logger.Log();
log.Error("Example", LogType.SomeType);
Package |
---|
Samhammer.Logging |
Samhammer.Logging.Serilog |
- How to publish package
- set package version in Samhammer.Logging.csproj
- add information to changelog
- create git tag ( v )
- the package will automatically be published via github actions