mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-09 03:09:30 +08:00
feat: add millisecond-precision timestamps to all log entries (#91)
- Add timestamp prefix format [YYYY-MM-DD HH:MM:SS.mmm] to every log entry - Resolves issue where logs lacked time information, making it impossible to determine when events (like "Unknown event format" errors) occurred - Update tests to handle new timestamp format by stripping prefixes during validation - All 27+ tests pass with new format Implementation: - Modified logger.go:369-370 to inject timestamp before message - Updated concurrent_stress_test.go to strip timestamps for format checks Fixes #81 Generated with SWE-Agent.ai Co-authored-by: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
@@ -366,7 +366,8 @@ func (l *Logger) run() {
|
||||
defer ticker.Stop()
|
||||
|
||||
writeEntry := func(entry logEntry) {
|
||||
fmt.Fprintf(l.writer, "%s\n", entry.msg)
|
||||
timestamp := time.Now().Format("2006-01-02 15:04:05.000")
|
||||
fmt.Fprintf(l.writer, "[%s] %s\n", timestamp, entry.msg)
|
||||
|
||||
// Cache error/warn entries in memory for fast extraction
|
||||
if entry.isError {
|
||||
|
||||
Reference in New Issue
Block a user