Rennorb.Logging 1.1.0

dotnet add package Rennorb.Logging --version 1.1.0
NuGet\Install-Package Rennorb.Logging -Version 1.1.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="Rennorb.Logging" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rennorb.Logging --version 1.1.0
#r "nuget: Rennorb.Logging, 1.1.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 Rennorb.Logging as a Cake Addin
#addin nuget:?package=Rennorb.Logging&version=1.1.0

// Install Rennorb.Logging as a Cake Tool
#tool nuget:?package=Rennorb.Logging&version=1.1.0

SimpleLogger

d'fk you think it is...

Do this:

class Program {
  static Logger logger = new("Label");

  static void Main(string[] args)
  {
    logger.WriteLine("something to log");
  }
}

which will result in logs/0000current.log with

[20:48:29][INFO][Label] something to log

Or if you want to be fancy:

class Program {
  static Logger logger = new("Label");

  static void Main(string[] args)
  {
    using var _ = logger.NewBlock("block");
  }
}

which will result in logs/0000current.log with

[20:50:47][INFO][Main] 4A207594 << block
[20:50:47][INFO][Main] 4A207594 >> done with block

Also brings handling for static json config storage:

// this is your config class
internal static class Config
{
	[JsonIgnore]
	public const string FILE_SOURCE = "config/updater.json";

	public static string ProgramDllPath;
	public static string GithubRepoId;
	public static string PublicKeyPath;

#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. thank net core
	static Config()
#pragma warning restore CS8618 
	{
		//does the actual loading
		StaticConfig.LoadFromDisk(typeof(Config), FILE_SOURCE);
	}

	//required
	public static void SetDefaults()
	{
		ProgramDllPath = "program.dll";
		GithubRepoId   = "owner/repo";
		PublicKeyPath  = "res/public.pem";
	}

	//call this if you want to save your storage
	public static void SaveToDisk() => StaticConfig.SaveToDisk(typeof(Config), FILE_SOURCE);
}
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.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rennorb.Logging:

Package Downloads
Rennorb.Updater

an updater

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 451 5/3/2022
1.0.0 385 5/3/2022