Skip to content

Commit

Permalink
Readme fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chubrik committed Apr 7, 2023
1 parent e837fae commit 152208b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[![MIT license](https://img.shields.io/github/license/chubrik/XConsole)](https://github.com/chubrik/XConsole/blob/main/LICENSE)
[![NuGet downloads](https://img.shields.io/nuget/dt/XConsole)](https://www.nuget.org/packages/XConsole/)

Extended .NET console with coloring microsyntax, multiline pinning, write-to-position & most useful utils.
Extended .NET console with coloring microsyntax, multiline pinning, write-to-position and most useful utils.
It’s designed with a focus on performance for professional use in complex tasks:
a huge number of asynchronous logs, with the need to highlight important and pin summary data.
XConsole is safe for multitasking, safe for console buffer overflows (9000+ lines), very easy to use.
XConsole is safe for multitasking, safe for console buffer overflow (9000+ lines), very easy to use.

The main features are shown in the following image:

Expand Down Expand Up @@ -68,7 +68,7 @@ To make a multicolor message split it to parts with individual color prefixes
and pass them to single `WriteLine` method.
Be sure that your messages will not be broken by other threads.
```csharp
Console.WriteLine("G`This line is colorized using simple microsyntax"); // Single color
Console.WriteLine("G`This line is colored using simple microsyntax"); // Single color
Console.WriteLine("C`It is easy ", "Wb`to use many", "R` colors in ", "Y`one message"); // Multicolor
```
![XConsole single color](https://raw.githubusercontent.com/chubrik/XConsole/main/img/colors-standard.png)
Expand Down Expand Up @@ -103,9 +103,9 @@ Console.NO_COLOR = true; // Disable all colors

## <a name="pinning"></a>Pinning
You can pin some text below regular log messages with the `Pin` method.
Pinned text can be static or dynamic, contain one or more lines, and of course can be colorized.
Pinned text can be static or dynamic, contain one or more lines, and of course can be colored.
The dynamic pin will be automatically updated every time the `Write` or `WriteLine` methods are called.
Pin is resistant to line wrapping and to console buffer overflows (9000+ log lines).
Pin is resistant to line wrapping and to console buffer overflow (9000+ log lines).

```csharp
Console.Pin("Simple static pin"); // Simple static pin
Expand All @@ -129,11 +129,11 @@ Console.Unpin(); // Remove pin
<br><br>

## <a name="positioning"></a>Positioning
XConsole provides a `ConsolePosition` structure, which is a position in the console area.
XConsole provides a `ConsolePosition` structure, which is a position within the console buffer area.
This is an important feature if you have a lot of log messages.
This structure is resistant to console buffer overflows (9000+ log lines)
and always points to the correct position in the console area.
Each `Write` and `WriteLine` method returns a start and end position.
This structure is resistant to console buffer overflow (9000+ log lines)
and always points to the correct position within the console buffer area.
Each `Write` and `WriteLine` method returns a begin and end position.
You can save them and use later to rewrite the text or add text to the end of the message.
To do this, `ConsolePosition` has its own `Write` method, which returns a new end position.

Expand Down
4 changes: 2 additions & 2 deletions XConsole.Demo/Screenshots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static void Summary()
Console.WriteLine("Regular log message: 12 apples");
Console.WriteLine("Regular log message: 8 bananas");
Console.WriteLine("Regular log message: 14 limes");
Console.WriteLine("G`This line is colorized using simple microsyntax");
Console.WriteLine("G`This line is colored using simple microsyntax");
Console.WriteLine("Regular log message: 7 apples");
Console.WriteLine("Regular log message: 21 bananas");
Console.WriteLine("Regular log message: 3 limes");
Expand Down Expand Up @@ -61,7 +61,7 @@ public static void Summary()

public static void ColorsStandard()
{
Console.WriteLine("G`This line is colorized using simple microsyntax");
Console.WriteLine("G`This line is colored using simple microsyntax");
Console.WriteLine("C`It is easy ", "Wb`to use many", "R` colors in ", "Y`one message");
}

Expand Down
3 changes: 1 addition & 2 deletions XConsole/Utils/ConsoleAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ private async Task StartAsync(CancellationToken cancellationToken)
for (; ; )
try
{
for (; ; )
await LoopAsync(cancellationToken).ConfigureAwait(false);
await LoopAsync(cancellationToken).ConfigureAwait(false);
}
catch (ArgumentOutOfRangeException)
{
Expand Down
Binary file modified img/colors-standard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 152208b

Please sign in to comment.