ExtremelySimpleLogger 1.4.1-ci.0
ExtremelySimpleLogger is a very simple logger for .NET programs.
To set up an extremely simple logger, add a reference to the NuGet package to your project file. Remember to change the VERSION
to the most recent one.
<ItemGroup>
<PackageReference Include="ExtremelySimpleLogger" Version="VERSION" />
</ItemGroup>
Next, you have to create an instance of the Logger
class:
var logger = new Logger {
Name = "My Logger",
Sinks = {
new FileSink("Log.txt", append: true),
new ConsoleSink()
}
};
Since there are multiple ways for logging data to be processed, the logger needs to receive a set of Sink
instances. By default, the following sinks are available:
FileSink
, which outputs logging data to a fileConsoleSink
, which outputs logging data to the default consoleDirectorySink
, which outputs logging data to a set of files and automatically manages how many old logs are keptStringSink
, which stores logging data in a string
There are multiple ways to easily log messages with your newly created logger:
// Logging info
logger.Log(LogLevel.Info, "Some information");
logger.Info("Some information, but shorter");
// Logging exceptions
try {
// some dangerous code
} catch (Exception e) {
logger.Error("An exception was thrown", e);
}
For more information, you can also check out the sample.
No packages depend on ExtremelySimpleLogger.
.NET Framework 4.5
- No dependencies.
.NET 8.0
- No dependencies.
.NET Standard 2.0
- No dependencies.
Version | Downloads | Last updated |
---|---|---|
1.4.1-ci.0 | 42 | 12/01/2023 |
1.4.0-ci.0 | 38 | 12/01/2023 |
1.3.3-ci.0 | 39 | 11/30/2023 |
1.3.2-ci.0 | 33 | 11/30/2023 |
1.3.1-ci.0 | 40 | 11/30/2023 |
1.3.0-15 | 54 | 05/08/2023 |
1.3.0-14 | 54 | 05/08/2023 |
1.3.0-13 | 73 | 10/05/2022 |
1.2.5-12 | 50 | 10/05/2022 |
1.2.5-11 | 45 | 10/05/2022 |
1.2.5-10 | 168 | 01/17/2022 |
1.2.4-9 | 128 | 01/17/2022 |
1.2.4-8 | 144 | 12/29/2021 |
1.2.4-7 | 127 | 12/29/2021 |
1.2.3-8 | 152 | 12/29/2021 |
1.2.3-6 | 121 | 12/29/2021 |
1.2.3-5 | 140 | 12/29/2021 |
1.2.3-4 | 135 | 12/29/2021 |
1.2.3-3 | 135 | 12/29/2021 |
1.2.3-2 | 125 | 12/29/2021 |
1.2.2-7 | 143 | 12/29/2021 |
1.2.2-6 | 116 | 12/29/2021 |
1.2.1-5 | 135 | 12/29/2021 |
1.2.1-4 | 136 | 12/29/2021 |
1.2.0-3 | 131 | 12/29/2021 |
1.2.0-2 | 119 | 12/29/2021 |
1.2.0-1 | 129 | 12/29/2021 |