SimpLog 1.0.0
Prefix ReservedSee the version list below for details.
dotnet add package SimpLog --version 1.0.0
NuGet\Install-Package SimpLog -Version 1.0.0
<PackageReference Include="SimpLog" Version="1.0.0" />
paket add SimpLog --version 1.0.0
#r "nuget: SimpLog, 1.0.0"
// Install SimpLog as a Cake Addin #addin nuget:?package=SimpLog&version=1.0.0 // Install SimpLog as a Cake Tool #tool nuget:?package=SimpLog&version=1.0.0
SimpLog NuGet Package
Simple NuGet package to write log files when you need.
Statuses
- Trace → This should be used during development to track bugs, but never committed to your VCS.
- Debug → log at this level about anything that happens in the program. This is mostly used during debugging, and I’d advocate trimming down the number of debug statement before entering the production stage, so that only the most meaningful entries are left, and can be activated during troubleshooting.
- Info → Log at this level all actions that are user-driven, or system specific (ie regularly scheduled operations…)
- Notice → This will certainly be the level at which the program will run when in production. Log at this level all the notable events that are not considered an error.
- Warn → Log at this level all events that could potentially become an error. For instance if one database call took more than a predefined time, or if an in-memory cache is near capacity. This will allow proper automated alerting, and during troubleshooting will allow to better understand how the system was behaving before the failure.
- Error → Log every error condition at this level. That can be API calls that return errors or internal error conditions.
- Fatal → Too bad, it’s doomsday. Use this very scarcely, this shouldn’t happen a lot in a real program. Usually logging at this level signifies the end of the program. For instance, if a network daemon can’t bind a network socket, log at this level and exit is the only sensible thing to do.
TraceFast, DebugFast, InfoFast, NoticeFast, WarnFast, ErrorFast, FatalFast are faster than the ordinary methods in this library but there is a slight possibility of loosing data.
Configuration in Program.cs
builder.Services.SimpLog({1}, {2}); {1} → can be null or path of the folder where the log to be saved {2} → can be null or name of the log file for the project
Configuration in Controller
private readonly ISimpLog _simpLog;
public HomeController( ISimpLog simpLog) { _simpLog = simpLog; }
Use it in Action method
_simpLog.InfoFast("Your message here!"); → This is using buffer memory so there is a slight possibility in losing data but it is much more faster _simpLog.Info("Your message here!"); → This is direct saving and there is no way of loosing data. _simpLog.Info("Your message here!", {3}, {4}); → This is direct saving and there is no way of loosing data.
{3} and {4} are optional if {1} and {2} are not null!
{3} → path of the log file {4} → name of the log file
If you did not set file name and path then the library won't work. If you set both, the file path and name will be {3} and {4}.
Hope you enjoy the NuGet Package! 😃
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.2.6 | 124 | 4/21/2024 |
2.2.5 | 167 | 3/20/2024 |
2.2.4 | 640 | 11/22/2023 |
2.2.3 | 535 | 10/23/2023 |
2.2.2 | 530 | 10/17/2023 |
2.2.1 | 580 | 9/30/2023 |
2.2.0 | 505 | 9/15/2023 |
2.1.2 | 537 | 8/22/2023 |
2.1.1 | 532 | 7/13/2023 |
1.1.2 | 524 | 6/11/2023 |
1.1.1 | 550 | 3/6/2023 |
1.1.0 | 640 | 3/1/2023 |
1.0.0 | 639 | 1/14/2023 |
0.0.1-alpha | 571 | 3/29/2022 |