Files
ClawdDotNet/src/ClawdDotNet.Core/Logging/LogEntry.cs
T
RichardandClaude Opus 4.8 2fed388c99 Initial commit: ClawdDotNet
Import des bestehenden Projektstands in Git.
- .NET 10 WinForms Anwendung (Multi-Agent / Tool-System)
- .gitignore fuer Build-Artefakte, Secrets und Runtime-Daten ergaenzt

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 18:21:46 +02:00

30 lines
685 B
C#

namespace ClawdDotNet.Core.Logging;
public sealed record LogEntry(
DateTime Timestamp,
LogLevel Level,
string Module,
string Message,
Exception? Exception = null
)
{
public string Format(string timestampFormat)
{
var levelTag = Level switch
{
LogLevel.Debug => "DBG",
LogLevel.Info => "INF",
LogLevel.Warn => "WRN",
LogLevel.Error => "ERR",
_ => "???"
};
var line = $"[{Timestamp.ToString(timestampFormat)}] [{levelTag}] {Message}";
if (Exception is not null)
line += Environment.NewLine + Exception.ToString();
return line;
}
}