Skip to content

Commit

Permalink
Use Lunet.Extensions.Logging.SpectreConsole for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Apr 2, 2022
1 parent 2c9c58a commit f29e7b7
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 1,016 deletions.
33 changes: 33 additions & 0 deletions src/dotnet-releaser/Logging/AnsiConsoleOutputOverride.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.IO;
using System.Text;
using Spectre.Console;

namespace DotNetReleaser.Logging;

/// <summary>
/// Allows to override the output to set the width/heigth (e.g for console out in GitHub Action)
/// </summary>
public class AnsiConsoleOutputOverride : IAnsiConsoleOutput
{
private readonly IAnsiConsoleOutput _delegate;

public AnsiConsoleOutputOverride(IAnsiConsoleOutput @delegate)
{
_delegate = @delegate;
Width = 80;
Height = 80;
}

public void SetEncoding(Encoding encoding)
{
_delegate.SetEncoding(encoding);
}

public TextWriter Writer => _delegate.Writer;

public bool IsTerminal => _delegate.IsTerminal;

public int Width { get; set; }

public int Height { get; set; }
}
1 change: 1 addition & 0 deletions src/dotnet-releaser/Logging/ISimpleLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Reflection;
using System.Threading;
using DotNetReleaser.Helpers;
using Lunet.Extensions.Logging.SpectreConsole;
using Microsoft.Extensions.Logging;
using Spectre.Console;
using Spectre.Console.Rendering;
Expand Down
345 changes: 0 additions & 345 deletions src/dotnet-releaser/Logging/SpectreConsoleLogger.cs

This file was deleted.

0 comments on commit f29e7b7

Please sign in to comment.