SimpLog 0.0.1-alpha

Prefix Reserved
This is a prerelease version of SimpLog.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SimpLog --version 0.0.1-alpha                
NuGet\Install-Package SimpLog -Version 0.0.1-alpha                
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="0.0.1-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpLog --version 0.0.1-alpha                
#r "nuget: SimpLog, 0.0.1-alpha"                
#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=0.0.1-alpha&prerelease

// Install SimpLog as a Cake Tool
#tool nuget:?package=SimpLog&version=0.0.1-alpha&prerelease                

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.

Configuration in Program.cs

builder.Services.SimpleLog({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 ILogService logService;

public HomeController( ILogService logService) { logService = logService; }

Use it in Action method

logService.Info("Your message here!"); logService.Info("Your message here!", {3}, {4});

{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 127 4/21/2024
2.2.5 169 3/20/2024
2.2.4 642 11/22/2023
2.2.3 537 10/23/2023
2.2.2 532 10/17/2023
2.2.1 582 9/30/2023
2.2.0 507 9/15/2023
2.1.2 539 8/22/2023
2.1.1 534 7/13/2023
1.1.2 526 6/11/2023
1.1.1 552 3/6/2023
1.1.0 642 3/1/2023
1.0.0 641 1/14/2023
0.0.1-alpha 573 3/29/2022