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>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user