e1.0.0 Initial commit, restructured and refactored logger package, used config package for configuration management.

This commit is contained in:
2025-04-22 11:29:34 -04:00
commit b78da2b449
15 changed files with 2621 additions and 0 deletions

23
state.go Normal file
View File

@ -0,0 +1,23 @@
package log
import (
"sync/atomic"
)
// State encapsulates the runtime state of the logger
type State struct {
IsInitialized atomic.Bool
LoggerDisabled atomic.Bool
ShutdownCalled atomic.Bool
DiskFullLogged atomic.Bool
DiskStatusOK atomic.Bool
ProcessorExited atomic.Bool // Tracks if the processor goroutine is running or has exited
CurrentFile atomic.Value // stores *os.File
CurrentSize atomic.Int64 // Size of the current log file
EarliestFileTime atomic.Value // stores time.Time for retention
DroppedLogs atomic.Uint64 // Counter for logs dropped
LoggedDrops atomic.Uint64 // Counter for dropped logs message already logged
ActiveLogChannel atomic.Value // stores chan logRecord
}