Add proper godoc comments to exported items in: - internal/globals: Appname, Version, Commit variables; Globals type; New function - internal/log: LogLevel type; level constants; Config type; Initialize, Fatal, Error, Warn, Notice, Info, Debug functions and variants; TTYHandler type and methods; Module variable; LogOptions type
25 lines
427 B
Go
25 lines
427 B
Go
package log
|
|
|
|
import (
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
// Module exports logging functionality for dependency injection.
|
|
var Module = fx.Module("log",
|
|
fx.Invoke(func(cfg Config) {
|
|
Initialize(cfg)
|
|
}),
|
|
)
|
|
|
|
// New creates a new logger configuration from provided options.
|
|
func New(opts LogOptions) Config {
|
|
return Config(opts)
|
|
}
|
|
|
|
// LogOptions are provided by the CLI.
|
|
type LogOptions struct {
|
|
Verbose bool
|
|
Debug bool
|
|
Cron bool
|
|
}
|