Documentation ¶
Index ¶
- Constants
- Variables
- func Init(cfg Config)
- type Config
- type Logger
- func (s *Logger) Alert(m string)
- func (s *Logger) Alertf(format string, va ...any)
- func (s *Logger) Close()
- func (s *Logger) Debug(m string)
- func (s *Logger) Debugf(format string, va ...any)
- func (s *Logger) Error(m string)
- func (s *Logger) Errorf(format string, va ...any)
- func (s *Logger) Fatal(m string)
- func (s *Logger) Fatalf(format string, va ...any)
- func (s *Logger) Info(m string)
- func (s *Logger) Infof(format string, va ...any)
- func (s *Logger) Init()
- func (s *Logger) IsAlert() bool
- func (s *Logger) IsDebug() bool
- func (s *Logger) IsError() bool
- func (s *Logger) IsFatal() bool
- func (s *Logger) IsInfo() bool
- func (s *Logger) SetLevel(level string)
- func (s *Logger) SetName(name string)
- func (s *Logger) WithLevel(level string) *Logger
- func (s *Logger) WithName(name string) *Logger
Constants ¶
View Source
const ( Debug string = "DEBUG" Info string = "INFO" Alert string = "ALERT" Error string = "ERROR" Fatal string = "FATAL" )
constants for logging levels
Variables ¶
Levels defining a list of levels
Functions ¶
Types ¶
type Config ¶
type Config struct { Level string `yaml:"level"` Filename string `yaml:"filename"` Gelfurl string `yaml:"gelf-url"` Gelfport int `yaml:"gelf-port"` }
Config configuration for the gelf logging
type Logger ¶
type Logger struct { Level string LevelInt int GelfURL string GelfPort int SystemID string Attrs map[string]any Filename string // contains filtered or unexported fields }
Logger main type for logging
var Root Logger
Root to use for all logging
func (*Logger) Errorf ¶
Errorf logs a message at level Error on the standard logger with formatting.
func (*Logger) Fatalf ¶
Fatalf logs a message at level Fatal on the standard logger with formatting.
Click to show internal directories.
Click to hide internal directories.