SimpLog 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package SimpLog --version 1.0.0
NuGet\Install-Package SimpLog -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpLog" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpLog --version 1.0.0
#r "nuget: SimpLog, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

  1. Trace → This should be used during development to track bugs, but never committed to your VCS.
  2. 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.
  3. Info → Log at this level all actions that are user-driven, or system specific (ie regularly scheduled operations…)
  4. 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.
  5. 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.
  6. Error → Log every error condition at this level. That can be API calls that return errors or internal error conditions.
  7. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 86 4/21/2024
2.2.5 137 3/20/2024
2.2.4 612 11/22/2023
2.2.3 511 10/23/2023
2.2.2 497 10/17/2023
2.2.1 552 9/30/2023
2.2.0 482 9/15/2023
2.1.2 511 8/22/2023
2.1.1 501 7/13/2023
1.1.2 501 6/11/2023
1.1.1 528 3/6/2023
1.1.0 618 3/1/2023
1.0.0 614 1/14/2023
0.0.1-alpha 549 3/29/2022