e1.0.0 Initial commit, restructured and refactored logger package, used config package for configuration management.
This commit is contained in:
23
state.go
Normal file
23
state.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user