Using .Net Console In Elegant Way !
✔ Easy to use and develop , clean code , and also designed to be fully thread-safe.
✔ FluentConsole.Net uses fluent builder pattern.
✔ FluentConsole.Net has fluent extension methods to write directly on Console.
✔ FluentConsole.Net is able to use FastLog.Net logger to also log the data when printing on the Console.
- An elegant fluent builder pattern to work with Console 👇
FluentConsole.Console
.WithFontColor(ConsoleColor.Yellow)
.WithBackColor(ConsoleColor.DarkGray)
.Write(DateTime.Now.ToString())
.AddSpace()
.WriteLine("Fluent Console For .Net")
.AddCharacter('*', 20)
.AddBreakLine(2)
.WriteLine("Developed By Shayan Firoozi")
.Print();
- Another Example with FastLog.Net , high performance logger 👇
FluentConsole.AttachLogger(fastLogger);
FluentConsole.Console
.WithTitle("This is the Fluent Console For .Net")
.WithFontColor(ConsoleColor.Yellow)
.AddLine(LineWidth: 20)
.Write("Who wants to live forever ?!")
.Beep()
.PrintAndLog();
- Also u can easily use built-in Extension Methods 👇
1364.WriteLineOnConsole(Formatted: true);
true.WriteLineOnConsole();
false.WriteLineOnConsole(YesNoFormat: true);
// Also for List<string>
List<string> greatest = new List<string>() { "David Gilmour", "Joe Satriani", "Stevie Ray Vaughan", "Slash !", "Paul Mccartney" };
greatest.WriteLineOnConsole();
// Printing your Exception object as easy as hell !
new InvalidOperationException("This a test exception I want to throw !!").WriteLineOnConsoleWithJSON();
new InvalidOperationException("This a test exception I want to throw !!").WriteLineOnConsole();
// Print DateTime object in proper and also optional format on console
FluentConsole.Console.WriteLine(DateTime.Now).Print();
FluentConsole.Console.WriteLine(DateTime.Now,"HH:mm:ss").Print();
- FastConsole methods 👇
FastConsole.PrintText("This is a Normal text !\n");
FastConsole.PrintInfo("This is an Info text !\n");
FastConsole.PrintNote("This is a Note text !\n");
FastConsole.PrintTodo("This is a Todo text !\n");
FastConsole.PrintWarning("This is a Warning message !\n");
FastConsole.PrintAlert("This is an Alert message !\n");
FastConsole.PrintDebug("This is a Debug message !\n");
FastConsole.PrintError("This is an Error message !\n");
FastConsole.PrintException(new InvalidCastException("This is a test Exception from \"FluentConsole.Net\"\n"));
FastConsole.PrintSystem("This is a System message!\n");
FastConsole.PrintSecurity("This is a Security message!\n");
- Symbolic Print with Style methods 👇
FluentConsole.FastConsole.PrintSymbolicText("I AM A STYLISH TEXT", FontStyle.StyleA, ConsoleColor.DarkCyan);
Please visit FluentConsole.Net Github repository for source code and more info : FluentConsole.Net On GitHub