e1.7.0 Timestamps improvements.

This commit is contained in:
2025-07-13 17:08:09 -04:00
parent cf37614e35
commit 2e410be060
7 changed files with 150 additions and 66 deletions

View File

@ -174,6 +174,11 @@ func (l *Logger) applyAndReconfigureLocked() error {
return fmtErrorf("failed to create log directory '%s': %w", dir, err)
}
// Update serializer format when config changes
if tsFormat, err := l.config.String("log.timestamp_format"); err == nil && tsFormat != "" {
l.serializer.setTimestampFormat(tsFormat)
}
// Get current state
wasInitialized := l.state.IsInitialized.Load()
disableFile, _ := l.config.Bool("log.disable_file")
@ -281,6 +286,7 @@ func (l *Logger) loadCurrentConfig() *Config {
cfg.Extension, _ = l.config.String("log.extension")
cfg.ShowTimestamp, _ = l.config.Bool("log.show_timestamp")
cfg.ShowLevel, _ = l.config.Bool("log.show_level")
cfg.TimestampFormat, _ = l.config.String("log.timestamp_format")
cfg.BufferSize, _ = l.config.Int64("log.buffer_size")
cfg.MaxSizeMB, _ = l.config.Int64("log.max_size_mb")
cfg.MaxTotalSizeMB, _ = l.config.Int64("log.max_total_size_mb")