GenericLoggingSystem_unsigned-ru 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package GenericLoggingSystem_unsigned-ru --version 1.0.2
                    
NuGet\Install-Package GenericLoggingSystem_unsigned-ru -Version 1.0.2
                    
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="GenericLoggingSystem_unsigned-ru" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GenericLoggingSystem_unsigned-ru" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="GenericLoggingSystem_unsigned-ru" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GenericLoggingSystem_unsigned-ru --version 1.0.2
                    
#r "nuget: GenericLoggingSystem_unsigned-ru, 1.0.2"
                    
#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.
#:package GenericLoggingSystem_unsigned-ru@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GenericLoggingSystem_unsigned-ru&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=GenericLoggingSystem_unsigned-ru&version=1.0.2
                    
Install as a Cake Tool

Welcome GenericLoggingSystem!

Generic logging system is a C# .NET Core library that provides you with pre-written functionality to

  1. Log to the Console
  2. Log to a file in a specified directory
  3. Create and customize new or already existing log formats

You can download and install the lastest stable version of this library on NuGet or in the NuGet Package Manager in Visual Studio.

Getting Started

First, include the before you log anything, include the "GenericLoggingSystem" namespace and Initialize the LogStream.

// Will set the logfile directory to the assembly directory/Logs/{date}.log
LogStream.Initialize();

OR

//if you want to specify a directory for the logfile yourself
LogStream.Initialize("C:/AllOfMyLogfiles/MyTestApp");

After initializing you can either:

  1. Use an existing Log class:
public static void Main()
{
    LogStream.Initialize();

    try
    {
        throw new Exception("This code totally just broke! Let's log it to both the console, " +
            "and a file for later inspection.");
    }
    catch (Exception e)
    {
        //no need to store this, it will do what it is made to do, Log to both the file and the console.
        new SeverityLog("Startup", e.Message, Severity.Error, e);
    }
}

Console and log file output:

[ERROR   ] 18:29:31 Startup      This code totally just broke! Let's log it to both the console, and a     file for later inspection.
    System.Exception: This code totally just broke! Let's log it to both the console, and a file for later inspection.
    at HaikhuuStockDisplayBot.Program.Main() in H:\BotProjects\HaikhuuStockDisplayBot\Program.cs:line 25
  1. Create your own You can create your own or override existing LogClasses by creating a new class that Inherits the GenericLogSystem.Log class. The Log class contains virtual functions you can override:
// ! YOU NEED TO OVERRIDE THIS ONE !
// This function returns the string that will get logged to both the console and the file
public override string Serialize()
    => $"Formatted logging string here {MyVariable1} is doing amazing!"; 

// This one is optional, the base function will write the serialized string into the
// console and the logfile, but if you want to make it do something extra,
// you can do so here!
public override void Execute()
{
    base.Execute();
    //something extra here!
}

A full example of a logging class can be found here

Feature requests & Issues

Feel free to open Issues on the github page for feature requests, or any issues that might occur with the library.

Versioning

This library generally abides by Semantic Versioning. Packages are published in MAJOR.MINOR.PATCH version format.

An increment of the PATCH component always indicates that an internal-only change was made, generally a bugfix. These changes will not affect the public-facing API in any way, and are always guaranteed to be forward- and backwards-compatible with your codebase, any pre-compiled dependencies of your codebase.

An increment of the MINOR component indicates that some addition was made to the library. All previously written code will keep working.

An increment of the MAJOR component indicates that there are breaking changes which will break previously written code, These changes will be listed in release descriptions.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.

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
1.0.3 550 7/8/2021
1.0.2 476 7/7/2021
1.0.1 486 7/7/2021
1.0.0 489 7/7/2021