NeoSimpleLogger 1.4.0

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

NeoSimpleLogger README

📦 Overview

NeoSimpleLogger is a lightweight, color-coded logging utility for .NET applications. It provides structured logging with timestamps, customizable colors for different log levels, and optional stack trace output in debug mode. Perfect for debugging and monitoring application behavior.


🎨 Features

  • Color-Coded Log Levels:
    • INFO (Green)
    • WARN (Yellow)
    • FATAL (Red)
    • ERROR (Red)
    • DEBUG (Magenta)
  • Customizable Colors: Define your own color scheme for each log level.
  • Timestamps: Automatically adds the current time in HH:mm:ss.fff format.
  • Debug Stack Trace: In DEBUG mode, shows the call stack for non-ERROR/WARN logs.

📌 Usage

Default Logger

using NeoSimpleLogger;

var logger = new Logger(Logger.OutputType.Console);
logger.LogInformation("Application started");
logger.LogWarning("Low memory detected");
logger.LogError("Critical failure occurred");
logger.LogDebug("Debugging internal state");
logger.LogCritical("App is dead");

📋 Example Output

[14:30:45.123] INFO   Application started
[14:30:45.124] WARN   Low memory detected
[14:30:45.125] ERROR  Critical failure occurred
[14:30:45.126] DEBUG  Debugging internal state
[14:30:45.125] FATAL  App closed unsuccessfuly 

🔍 Debug Mode (Optional)

In DEBUG builds, the logger includes the call stack for non-ERROR/WARN logs:

[14:30:45.126] DEBUG  Debugging internal state
Call stack:    at NeoSimpleLogger.Logger.Debug(String message)
               at MyApplication.Main(String[] args)

⚠️ Notes

  • Color Support: Requires a terminal or console that supports ANSI escape codes.
  • Performance: Minimal overhead due to simple formatting and no external dependencies.
  • License: BSD-3 Clause License (see LICENSE file).

📦 Installation

Add the NeoSimpleLogger namespace to your project. No external packages required.


📚 License

[BSD-3 Clause License] © 2025 Ruzen42


🛠️ Contributing

Pull requests and issues are welcome!

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.