Documentation
¶
Index ¶
- Variables
- func Auth() *slog.Logger
- func ClientAPI() *slog.Logger
- func ClientCache() *slog.Logger
- func ClientConnection() *slog.Logger
- func ClientCore() *slog.Logger
- func ClientData() *slog.Logger
- func ClientMain() *slog.Logger
- func ClientSession() *slog.Logger
- func ClientTools() *slog.Logger
- func Close() *slog.Logger
- func Config() *slog.Logger
- func Event() *slog.Logger
- func EventStore() *slog.Logger
- func GetAllComponents() []string
- func GetLogger(component string) *slog.Logger
- func InitializeLoggers(cfg *cfgType.ServerConfig)
- func Log() *slog.Logger
- func Mongo() *slog.Logger
- func MongoPurge() *slog.Logger
- func MongoQuery() *slog.Logger
- func MongoStore() *slog.Logger
- func RelayAPI() *slog.Logger
- func RelayClient() *slog.Logger
- func RelayConnection() *slog.Logger
- func Req() *slog.Logger
- func StartPeriodicLogTrimmer(logFilePath string, maxSizeMB int, checkIntervalMinutes int, backupCount int)
- func Startup() *slog.Logger
- func UserSync() *slog.Logger
- func Util() *slog.Logger
- func Validation() *slog.Logger
- type JSONLogWriter
- func (j *JSONLogWriter) Close()
- func (j *JSONLogWriter) Enabled(ctx context.Context, level slog.Level) bool
- func (j *JSONLogWriter) Handle(ctx context.Context, r slog.Record) error
- func (j *JSONLogWriter) WithAttrs(attrs []slog.Attr) slog.Handler
- func (j *JSONLogWriter) WithGroup(name string) slog.Handler
- type LoggerRegistry
- type PrettyLogWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var Registry = &LoggerRegistry{ loggers: make(map[string]*slog.Logger), suppressedComponents: make(map[string]bool), }
Global registry instance
Functions ¶
func ClientCache ¶ added in v0.4.1
func ClientConnection ¶ added in v0.4.1
func ClientCore ¶ added in v0.4.1
func ClientData ¶ added in v0.4.1
func ClientMain ¶ added in v0.4.1
func ClientSession ¶ added in v0.4.1
func ClientTools ¶ added in v0.4.1
func EventStore ¶
func GetAllComponents ¶ added in v0.4.1
func GetAllComponents() []string
GetAllComponents returns a slice of all component names used by the logger functions
func InitializeLoggers ¶
func InitializeLoggers(cfg *cfgType.ServerConfig)
InitializeLoggers sets up the central logging system with the given configuration
func MongoPurge ¶
func MongoQuery ¶
func MongoStore ¶
func RelayClient ¶ added in v0.4.1
func RelayConnection ¶ added in v0.4.1
func StartPeriodicLogTrimmer ¶
func StartPeriodicLogTrimmer(logFilePath string, maxSizeMB int, checkIntervalMinutes int, backupCount int)
StartPeriodicLogTrimmer starts a goroutine that periodically checks and manages log size
func Validation ¶
Types ¶
type JSONLogWriter ¶
type JSONLogWriter struct {
// contains filtered or unexported fields
}
JSONLogWriter writes logs in a pretty-printed JSON array format
func NewJSONLogWriter ¶
func NewJSONLogWriter(filePath string, level slog.Level, maxSizeMB int, backupCount int, suppressedComponents map[string]bool) *JSONLogWriter
NewJSONLogWriter creates a new instance of JSONLogWriter
func (*JSONLogWriter) Close ¶
func (j *JSONLogWriter) Close()
Close is now a no-op since logs are written properly on each entry.
type LoggerRegistry ¶
type LoggerRegistry struct {
// contains filtered or unexported fields
}
LoggerRegistry maintains a map of all loggers by component name
type PrettyLogWriter ¶
type PrettyLogWriter struct {
// contains filtered or unexported fields
}
PrettyLogWriter writes logs ONLY to a file
Click to show internal directories.
Click to hide internal directories.