Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shayanfiroozi/fluentconsole.net
Fluent Console For .Net ⬛
https://github.com/shayanfiroozi/fluentconsole.net
console console-app console-application console-tool csharp dotnet dotnetcore fluent helpers
Last synced: about 1 month ago
JSON representation
Fluent Console For .Net ⬛
- Host: GitHub
- URL: https://github.com/shayanfiroozi/fluentconsole.net
- Owner: ShayanFiroozi
- License: mit
- Created: 2023-06-02T20:03:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-08T19:02:07.000Z (6 months ago)
- Last Synced: 2024-08-10T07:51:11.775Z (5 months ago)
- Topics: console, console-app, console-application, console-tool, csharp, dotnet, dotnetcore, fluent, helpers
- Language: C#
- Homepage: https://www.nuget.org/packages/FluentConsole.Net/#readme-body-tab
- Size: 340 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README-Nuget.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Nuget](https://img.shields.io/nuget/v/FluentConsole.Net)](https://www.nuget.org/packages/FluentConsole.Net/#readme-body-tab)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=bugs)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ShayanFiroozi_FluentConsole.Net&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=ShayanFiroozi_FluentConsole.Net)
[![License](https://img.shields.io/github/license/shayanfiroozi/fluentconsole.net)](https://github.com/ShayanFiroozi/FluentConsole.Net/blob/master/LICENSE.md)# **FluentConsole.Net**
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**](https://github.com/ShayanFiroozi/FastLog.Net) logger to also log the data when printing on the **Console**.
## **How To Use ❔**
- An elegant fluent builder pattern to work with **Console** 👇
```csharp
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**](https://github.com/ShayanFiroozi/FastLog.Net) , high performance logger 👇
```csharp
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** 👇```csharp
1364.WriteLineOnConsole(Formatted: true);
true.WriteLineOnConsole();
false.WriteLineOnConsole(YesNoFormat: true);
// Also for List
List greatest = new List() { "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 👇
```csharp
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 👇
```csharpFluentConsole.FastConsole.PrintSymbolicText("I AM A STYLISH TEXT", FontStyle.StyleA, ConsoleColor.DarkCyan);
```
## GitHub Repository
Please visit FluentConsole.Net Github repository for source code and more info : [**FluentConsole.Net On GitHub**](https://github.com/ShayanFiroozi/FluentConsole.Net)