Skip to content

Commit

Permalink
Remove old formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
atrexus committed Aug 14, 2024
1 parent 2350e5a commit 2524244
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/Unluau.CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Logging;
using System.CommandLine;
using System.CommandLine;
using System.CommandLine.Parsing;
using Microsoft.Extensions.Logging.Abstractions;

namespace Unluau.CLI
{
Expand All @@ -18,16 +15,4 @@ static async Task<int> Main(string[] args)
return await rootCommand.InvokeAsync(args);
}
}

// Custom Console Formatter for UNIX Timestamp
public class UnixTimestampConsoleFormatter : ConsoleFormatter
{
public UnixTimestampConsoleFormatter() : base("unix") { }

public override void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider? scopeProvider, TextWriter textWriter)
{
var unixTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
textWriter.Write($"{unixTimestamp}: {logEntry.Formatter(logEntry.State, logEntry.Exception)}{Environment.NewLine}");
}
}
}

0 comments on commit 2524244

Please sign in to comment.