You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Using ILogColor with auto prefixILib.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 prefixILib.ILogColor("magenta","AUTH","User logged in");ILib.ILogColor("blue","DB","Connected to database");
Console Colors
// Set only foregroundILib.ISetConsoleColor("cyan");ILib.INotice("Cyan text");// Set only backgroundILib.ISetBgColor("blue");ILib.INotice("Text on blue background");// Set both foreground and backgroundILib.ISetConsoleColor("yellow","blue");ILib.INotice("Yellow text on blue background");// Reset colorsILib.IResetBgColor();// Reset only backgroundILib.IResetConsoleColor();// Reset both
Clear Console
ILib.INotice("Press any key to clear screen...");ILib.IReadKey();ILib.IClearConsole();ILib.INotice("Screen cleared!");
User Input
stringname=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 newlineILib.IWrite("Enter your age: ");stringage=ILib.IReadLine();// Write lineILib.IWriteLine($"You entered: {age}");
Timezone Examples
// Using UTC offsetstringvietnam=ILib.IGetTimeUtc("+7");stringny=ILib.IGetTimeUtc("-5");stringindia=ILib.IGetTimeUtc("+5:30");// Using IANA timezone (cross-platform)stringvn=ILib.IGetTimeZone("Asia/Ho_Chi_Minh");stringjp=ILib.IGetTimeZone("Asia/Tokyo");stringuk=ILib.IGetTimeZone("Europe/London");// Custom formatstringtime=ILib.IGetTimeZone("Asia/Ho_Chi_Minh","HH:mm dd/MM/yyyy");
Configuration
// Disable timestampsILib.ShowTimestamps=false;ILib.ILogInfo("No timestamp");// Output: [INFO] - No timestamp// Custom timestamp formatILib.TimestampFormat="HH:mm:ss";ILib.ILogInfo("With time only");// Output: [INFO] 14:30:45 - With time only// Enable debug modeILib.ISetDebug(true);ILib.ILogDebug("This will show");