EvelynTSMG.EasyLogger 1.0.1

dotnet add package EvelynTSMG.EasyLogger --version 1.0.1
                    
NuGet\Install-Package EvelynTSMG.EasyLogger -Version 1.0.1
                    
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="EvelynTSMG.EasyLogger" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EvelynTSMG.EasyLogger" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="EvelynTSMG.EasyLogger" />
                    
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 EvelynTSMG.EasyLogger --version 1.0.1
                    
#r "nuget: EvelynTSMG.EasyLogger, 1.0.1"
                    
#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 EvelynTSMG.EasyLogger@1.0.1
                    
#: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=EvelynTSMG.EasyLogger&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=EvelynTSMG.EasyLogger&version=1.0.1
                    
Install as a Cake Tool

What is EasyLogger?

EasyLogger is a C# logging library intended to be simple and easy to use.
It is NOT intended to:

  • have every feature under the sun,
  • maintain backwards compatibility across many versions of C#,
  • be the end all be all of C# logger libraries.

How to use EasyLogger?

Loggers need a LoggerConfig, as well as any amount of ILogWriters.
For documentation on the configuration, see EasyLogger/LoggerConfig.cs

For example, you can create a new Logger to write to the console with the default configuration like so:

Logger logger = new(new LoggerConfig(), new ConsoleLogWriter());

If you want to create multiple log files with the same configuration, a FileLoggerFactory is provided.
The factory will automatically add a FileLogWriter to created loggers.
Additional writers may be passed in the factory constructor. They will be directly used by created loggers, no copies will be made.
All loggers created by the factory will log to the logDirectory provided to the factory.

FileLoggerFactory loggerFactory = new("./logs/", new LoggerConfig(), new ConsoleLogWriter());
Logger appleLogger = loggerFactory.Create("apple");
Logger bananaLogger = loggerFactory.Create("banana");
Logger cherryLogger = loggerFactory.Create("cherry");

Remember to flush or close loggers before the application exits. Otherwise, there is no guarantee the loggers will properly flush.

Once you have a Logger, logging can be performed using the Log method. You must pass in the log level and message, like so:

appleLogger.Log(LogLevel.Info, "I like apples.");

Shorthand methods are provided for logging each supported level:

appleLogger.Trace("Talking about shorthand methods.");
appleLogger.Debug("I do not want bugs in my food.");
appleLogger.Verbose("I like green apples because they are sour.")
appleLogger.Info("I like apples.");
appleLogger.Warn("I do not like bananas.");
appleLogger.Error("Tomatoes are a berry.");
appleLogger.Fatal("I'm allergic to peanuts.");
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
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
1.0.1 247 9/25/2025
1.0.0 284 9/25/2025

README fix