mirror of
https://github.com/ChronosX88/log4sharp.git
synced 2024-11-09 11:41:00 +00:00
40 lines
832 B
Markdown
40 lines
832 B
Markdown
# Log4Sharp
|
|
|
|
Dead-simple colorful logger for C#/.NET Core.
|
|
|
|
I have not found any simple loggers in the .NET Core ecosystem that are not framework-specific and have easy usage, so I decided to write this one. Mostly inspired by various Golang loggers.
|
|
|
|
![](./assets/log.png)
|
|
|
|
## Install
|
|
|
|
```
|
|
dotnet add package Log4Sharp
|
|
```
|
|
|
|
## Usage
|
|
|
|
```c#
|
|
using Log4Sharp;
|
|
...
|
|
Log.Debug("Hello World!");
|
|
Log.Info("Hello World!");
|
|
Log.Warning("Hello World!");
|
|
Log.Error("Hello World!");
|
|
Log.Fatal("Hello World!");
|
|
```
|
|
|
|
You can also change log level output filter (by default it's set to `LogLevel.Error`):
|
|
|
|
```c#
|
|
Log.SetLogLevel(LogLevel.Debug); // Allow output of all log levels
|
|
```
|
|
|
|
## Contributing
|
|
|
|
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
|
|
## License
|
|
|
|
MIT © ChronosX88
|