Documentation
¶
Index ¶
- func CloseLogger()
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitLogger(cfg *Config) error
- func L() *logrus.Logger
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithField(key string, value interface{}) *logrus.Entry
- func WithFields(fields logrus.Fields) *logrus.Entry
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseLogger ¶
func CloseLogger()
CloseLogger closes current logger's file handles and clears the logger. Call during shutdown to release file descriptors. Safe to call multiple times.
func Fatal ¶
func Fatal(args ...interface{})
Fatal logs a fatal message and exits with status code 1. Note: This function calls os.Exit() and cannot be tested in unit tests. Any test attempting to cover this function would terminate the test process.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs a formatted fatal message and exits with status code 1. Note: This function calls os.Exit() and cannot be tested in unit tests. Any test attempting to cover this function would terminate the test process.
func InitLogger ¶
InitLogger initializes or reloads the global logger based on configuration. It atomically swaps in the new logger and closes previous file handles to prevent leaks. This function is safe to call multiple times for config reloading.
func L ¶
L returns the current logger instance. Callers should NOT cache the returned pointer across config reloads; instead, call logging.L() when you need to log. This ensures you always get the current logger after config reloads.