Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samhammerag/samhammer.logging
Logging abstraction for .NET Core
https://github.com/samhammerag/samhammer.logging
dotnet net-core-project-lib
Last synced: 23 days ago
JSON representation
Logging abstraction for .NET Core
- Host: GitHub
- URL: https://github.com/samhammerag/samhammer.logging
- Owner: SamhammerAG
- License: mit
- Created: 2020-10-15T11:31:07.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T20:03:33.000Z (about 2 months ago)
- Last Synced: 2024-11-28T18:49:47.578Z (25 days ago)
- Topics: dotnet, net-core-project-lib
- Language: C#
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Samhammer.Logging
Logging abstraction for .NET Core
## Usage
### Custom logger:
```csharp
public abstract class BaseLogger : Samhammer.Logging.BaseLogger, ILog
``````csharp
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.
### Setup & Use Logger
```csharp
Logger.Init(() => new SerilogLogger(), fallbackLogType);
``````csharp
ILog log = Logger.Log();log.Error("Example", LogType.SomeType);
```## Packages
| Package |
| --- |
| [Samhammer.Logging](https://www.nuget.org/packages/Samhammer.Logging/) |
| [Samhammer.Logging.Serilog](https://www.nuget.org/packages/Samhammer.Logging.Serilog/) |## Contribute
#### How to publish package
- 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