ColoredLogger 1.0.2
dotnet add package ColoredLogger --version 1.0.2
NuGet\Install-Package ColoredLogger -Version 1.0.2
<PackageReference Include="ColoredLogger" Version="1.0.2" />
<PackageVersion Include="ColoredLogger" Version="1.0.2" />
<PackageReference Include="ColoredLogger" />
paket add ColoredLogger --version 1.0.2
#r "nuget: ColoredLogger, 1.0.2"
#:package ColoredLogger@1.0.2
#addin nuget:?package=ColoredLogger&version=1.0.2
#tool nuget:?package=ColoredLogger&version=1.0.2
ColoredLogger đ¨
A lightweight, high-visibility logging library for .NET applications. ColoredLogger provides a set of fluent string extension methods to transform boring console output into structured, professional, and color-coded logs with zero configuration.
đ Installation
Install the package via the NuGet CLI:
dotnet add package ColoredLogger
đ Usage
Simply add using ColoredLogger; to your class. The library extends the string type, allowing you to trigger logs directly from your message strings.
1. Semantic Logging
Standardized methods for common application states. Each method handles the prefixing and coloring automatically.
"Server started on port 8080.".LogSuccess();
"Checking for updates...".LogInfo();
"Disk space is below 10%.".LogWarning();
"User authentication failed.".LogError();
Terminal Output:
â
[SUCCESS] Server started on port 8080.
âšī¸ [INFO] Checking for updates...
â ī¸ [!] Disk space is below 10%.
â [ERROR] User authentication failed.
2. Section Banners
LogBanner creates a centered, bordered header. It automatically detects your console's width to ensure the border spans the full window.
"DATABASE MIGRATION".LogBanner('=');
Terminal Output:
================================================================================
DATABASE MIGRATION
================================================================================
3. Basic & Custom Logging
Use .Log() for standard output without prefixes. You can optionally pass any ConsoleColor.
"Initialising modules...".Log();
"Processing background task...".Log(ConsoleColor.Cyan);
Terminal Output:
đ Initialising modules...
đš Processing background task...
đ Full Integration Example
Perfect for startup sequences or CLI tools:
using ColoredLogger;
"APP STARTUP".LogBanner('=');
"Loading environment variables...".Log();
"API Keys validated.".LogSuccess();
"Connecting to Database...".LogInfo();
"Connection timeout. Retrying (1/3)...".LogWarning();
"Critical Error: Could not connect to DB.".LogError();
"PROCESS TERMINATED".LogBanner('-');
Visual Preview:
================================================================================
APP STARTUP
================================================================================
âī¸ Loading environment variables...
â
[SUCCESS] API Keys validated.
âšī¸ [INFO] Connecting to Database...
â ī¸ [!] Connection timeout. Retrying (1/3)...
â [ERROR] Critical Error: Could not connect to DB.
--------------------------------------------------------------------------------
PROCESS TERMINATED
--------------------------------------------------------------------------------
âī¸ License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- 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.