DryFish.ILib 2026.9.0

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

DryFish.ILib

Build and Test NuGet Version NuGet Downloads License: MIT

A simple, lightweight C# library for console operations, logging, delays, and application control.

✨ Features

  • πŸ“ Multiple Log Levels - Notice, Warning, Info, Error, Debug, Complete
  • 🎨 Colored Console - Set foreground and background colors by name
  • ⏱️ Delays - Both synchronous and asynchronous delay methods
  • ⌨️ User Input - ReadLine and ReadKey with null safety
  • 🧹 Console Control - Clear console screen with exception handling
  • 🌍 Timezone Support - Cross-platform timezone conversion (IANA & Windows)
  • πŸ”§ Configurable - Toggle timestamps, custom formats, debug mode
  • πŸ“¦ Lightweight - Zero external dependencies
  • πŸšͺ Exit - Controlled application exit with status codes

πŸ“¦ Installation

.NET CLI

dotnet add package DryFish.ILib

Package Manager

NuGet\Install-Package DryFish.ILib

PackageReference

<PackageReference Include="DryFish.ILib" Version="2026.9.0" />

πŸš€ Quick Start

using DryFish.ILib;

// Optional configuration
ILib.ISetDebug(true);
ILib.TimestampFormat = "HH:mm:ss";

ILib.INotice("Application starting...");
ILib.ILogInfo("Initializing components");

// Get user input
string name = ILib.IReadLine("Enter your name: ");
ILib.ILogComplete($"Welcome, {name}!");

// Timezone example
string vnTime = ILib.IGetTimeZone("Asia/Ho_Chi_Minh");
ILib.ILogInfo($"Vietnam time: {vnTime}");

πŸ“š API Reference

Logging Methods

Method Description Example
INotice(string message) Display a notice message ILib.INotice("Hello");
IWarn(string message) Display a warning (yellow) ILib.IWarn("Warning!");
ILogInfo(string message) Info log with timestamp ILib.ILogInfo("Data saved");
ILogError(string message) Error log (red) ILib.ILogError("Failed!");
ILogComplete(string message) Success log with checkmark ILib.ILogComplete("Done!");
ILog(string prefix, string message) Custom prefixed log ILib.ILog("APP", "Message");
ILogColor(string color, string message) Colored log with auto prefix ILib.ILogColor("red", "Error!");
ILogColor(string color, string prefix, string message) Colored log with custom prefix ILib.ILogColor("cyan", "NET", "Connected");
ILogDebug(string message) Debug log (requires debug mode) ILib.ILogDebug("Value: 42");

Console Output Methods

Method Description Example
IWrite(string message) Write text without newline ILib.IWrite("Enter name: ");
IWriteLine(string message) Write line of text ILib.IWriteLine("Hello World!");

Control Methods

Method Description Example
IDelay(int milliseconds) Synchronous delay ILib.IDelay(500);
IDelayAsync(int milliseconds) Asynchronous delay await ILib.IDelayAsync(500);
IExit(int exitCode) Exit application ILib.IExit(0);

Input Methods

Method Description Example
IReadLine() Read line with null safety string input = ILib.IReadLine();
IReadLine(string prompt) Read line with prompt string name = ILib.IReadLine("Name: ");
IReadKey() Read single key var key = ILib.IReadKey();
IReadKey(bool intercept) Read key with display option ILib.IReadKey(true);
IReadKey(string prompt) Read key with prompt ILib.IReadKey("Press any key...");

Console Methods

Method Description Example
IClearConsole() Clear the console screen ILib.IClearConsole();

Console Color Methods

Method Description Example
ISetConsoleColor(string color) Set foreground color ILib.ISetConsoleColor("red");
ISetConsoleColor(string fg, string bg) Set both colors ILib.ISetConsoleColor("yellow", "blue");
ISetBgColor(string color) Set background color only ILib.ISetBgColor("blue");
IResetConsoleColor() Reset both foreground and background ILib.IResetConsoleColor();
IResetBgColor() Reset background color only ILib.IResetBgColor();

Supported colors: black, darkblue, darkgreen, darkcyan, darkred, darkmagenta, darkyellow, gray, grey, darkgray, darkgrey, blue, green, cyan, red, magenta, yellow, white

Timezone Methods

Method Description Example
IGetTimeUtc(string offset) UTC + offset ILib.IGetTimeUtc("+7");
IGetTimeUtc(string offset, string format) With custom format ILib.IGetTimeUtc("+7", "HH:mm");
IGetTimeZone(string timezoneId) IANA timezone ILib.IGetTimeZone("Asia/Ho_Chi_Minh");
IGetTimeZone(string id, string format) With custom format ILib.IGetTimeZone("America/New_York", "dd/MM/yyyy");

Timezone offset formats: "+7", "-5", "+730", "+7:30", "+0530"

Configuration

Property Type Default Description
ShowTimestamps bool true Show/hide timestamps in logs
TimestampFormat string "yyyy-MM-dd HH:mm:ss" Custom timestamp format
Method Description
ISetDebug(bool enabled) Enable/disable debug logging

πŸ’‘ Examples

Basic Logging

ILib.INotice("Server started");
ILib.ILogInfo("User logged in: admin");
ILib.ILogError("Database connection failed");
ILib.ILogComplete("Backup completed");

Colored Logging

// Using ILogColor with auto prefix
ILib.ILogColor("red", "This is an error message");
ILib.ILogColor("green", "Operation completed successfully");
ILib.ILogColor("yellow", "Warning: Low disk space");
ILib.ILogColor("cyan", "Debug: Variable x = 42");

// Using ILogColor with custom prefix
ILib.ILogColor("magenta", "AUTH", "User logged in");
ILib.ILogColor("blue", "DB", "Connected to database");

Console Colors

// Set only foreground
ILib.ISetConsoleColor("cyan");
ILib.INotice("Cyan text");

// Set only background
ILib.ISetBgColor("blue");
ILib.INotice("Text on blue background");

// Set both foreground and background
ILib.ISetConsoleColor("yellow", "blue");
ILib.INotice("Yellow text on blue background");

// Reset colors
ILib.IResetBgColor();      // Reset only background
ILib.IResetConsoleColor(); // Reset both

Clear Console

ILib.INotice("Press any key to clear screen...");
ILib.IReadKey();
ILib.IClearConsole();
ILib.INotice("Screen cleared!");

User Input

string name = ILib.IReadLine("Enter your name: ");
ILib.ILogInfo($"Hello, {name}!");

ConsoleKeyInfo? key = ILib.IReadKey("Press Y to continue: ");
if (key?.Key == ConsoleKey.Y)
{
    ILib.ILogComplete("Continuing...");
}

Direct Console Output

// Write without newline
ILib.IWrite("Enter your age: ");
string age = ILib.IReadLine();

// Write line
ILib.IWriteLine($"You entered: {age}");

Timezone Examples

// Using UTC offset
string vietnam = ILib.IGetTimeUtc("+7");
string ny = ILib.IGetTimeUtc("-5");
string india = ILib.IGetTimeUtc("+5:30");

// Using IANA timezone (cross-platform)
string vn = ILib.IGetTimeZone("Asia/Ho_Chi_Minh");
string jp = ILib.IGetTimeZone("Asia/Tokyo");
string uk = ILib.IGetTimeZone("Europe/London");

// Custom format
string time = ILib.IGetTimeZone("Asia/Ho_Chi_Minh", "HH:mm dd/MM/yyyy");

Configuration

// Disable timestamps
ILib.ShowTimestamps = false;
ILib.ILogInfo("No timestamp"); // Output: [INFO] - No timestamp

// Custom timestamp format
ILib.TimestampFormat = "HH:mm:ss";
ILib.ILogInfo("With time only"); // Output: [INFO] 14:30:45 - With time only

// Enable debug mode
ILib.ISetDebug(true);
ILib.ILogDebug("This will show");

Async Delay

async Task ProcessData()
{
    ILib.ILogInfo("Processing started");
    await ILib.IDelayAsync(2000);
    ILib.ILogComplete("Processing completed");
}

Progress Simulation

for (int i = 0; i <= 100; i += 20)
{
    ILib.ILogInfo($"Progress: {i}%");
    ILib.IDelay(500);
}
ILib.ILogComplete("Complete!");

πŸ§ͺ Running Tests

# Clone repository
git clone https://github.com/dryfish09/ILib.git

# Restore dependencies
dotnet restore

# Run tests
dotnet test

# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"

πŸ”§ Building from Source

# Build all frameworks
dotnet build src/main/DryFish.ILib.csproj --configuration Release

# Pack NuGet package
dotnet pack src/main/DryFish.ILib.csproj --configuration Release --output ./artifacts

# Include symbols for debugging
dotnet pack src/main/DryFish.ILib.csproj --configuration Release --output ./artifacts --include-symbols

πŸ“ Project Structure

ILib/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ DryFish.ILib.csproj
β”‚   β”‚   └── ILib.cs
β”‚   └── test/
β”‚       β”œβ”€β”€ DryFish.ILib.Test.csproj
β”‚       └── ILibTest.cs
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── build.yml
β”‚   └── dependabot.yml
β”œβ”€β”€ global.json
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── DryFish.ILib.sln

πŸ“‹ Requirements

  • .NET 6.0 or later
  • .NET Core 6.0+
  • .NET Framework 4.6.2+
  • .NET Standard 2.0
  • Compatible with Windows, Linux, and macOS

πŸ—ΊοΈ Roadmap

  • Basic logging (Notice, Warn, Info, Error, Complete)
  • Colored console output (foreground & background)
  • Sync/Async delays
  • User input methods
  • Direct console output (IWrite, IWriteLine)
  • Clear console screen
  • Cross-platform timezone
  • Debug mode
  • Configurable timestamps
  • Colored logging (ILogColor)
  • Background color control (ISetBgColor, IResetBgColor)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Guidelines:

  • Follow existing code style
  • Add tests for new features
  • Update documentation
  • Ensure all tests pass

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

DryFish

πŸ™ Acknowledgments

  • Built with .NET 6/7/8 and .NET Framework 4.6.2+
  • Tested with xUnit
  • CI/CD with GitHub Actions
  • Cross-platform timezone support
  • Dependabot for automated dependency updates

πŸ“ž Support

  • πŸ“§ Create an Issue
  • ⭐ Star the repository if you find it useful!
  • πŸ”” Watch for updates and new releases

Made with ❀️ by DryFish

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 is compatible.  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 is compatible.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2026.9.0 77 6/2/2026
2026.8.0 91 5/29/2026
2026.8.0-beta1 104 5/28/2026
2026.7.0 88 5/28/2026
2026.6.0 97 5/27/2026
2026.5.1 91 5/26/2026
2026.5.0 91 5/26/2026
2026.4.0 93 5/25/2026
2026.3.0 93 5/25/2026
2026.2.1 92 5/25/2026
2026.2.0 89 5/25/2026
2026.1.0 97 5/25/2026