Documentation ¶
Index ¶
- type FileMode
- type Level
- type LogConfig
- type Logger
- func (l *Logger) CapturePanic()
- func (l *Logger) Close() error
- func (l *Logger) Debugf(msg message.Reference, v ...any)
- func (l *Logger) Errorf(msg message.Reference, v ...any)
- func (l *Logger) Infof(msg message.Reference, v ...any)
- func (l *Logger) Setup(ctx context.Context, config LogConfig)
- func (l *Logger) Tracef(msg string, v ...any)
- func (l *Logger) Translate(msg message.Reference, v ...any) string
- func (l *Logger) Warnf(msg message.Reference, v ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileMode ¶
type FileMode string
FileMode is used to unmarshal a unix file mode from the config file.
type LogConfig ¶
type LogConfig struct { Name string Path string Size uint Mode FileMode Level Level Files uint Lang string }
LogConfig allows sending logs to rotating files.
type Logger ¶
type Logger struct { Wails logger.Logger // special interface for wails. File string // contains filtered or unexported fields }
Logger provides some methods with baked in assumptions.
func New ¶
func New() *Logger
New returns an uninitialized logger. Config is optional, but must be provided here or with Setup().
func (*Logger) CapturePanic ¶
func (l *Logger) CapturePanic()
CapturePanic can be deferred in any go routine to log any panic that occurs.
func (*Logger) Setup ¶
SetupLogging splits log writers into a file and/or stdout. Config is optional, but must be provided here or with New().
Click to show internal directories.
Click to hide internal directories.