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>
30 lines
685 B
C#
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;
|
|
}
|
|
}
|