Documentation
¶
Index ¶
Constants ¶
View Source
const ( // LevelTrace is a custom TRACE log level. LevelTrace = slog.Level(-8) // LevelFatal is a custom FATAL log level. LevelFatal = slog.Level(12) )
Variables ¶
View Source
var ( DefaultLogFile = "/app/foragd.log" Level slog.Level )
DefaultLogFile is the default log file location.
View Source
var LevelNames = map[slog.Leveler]string{ LevelTrace: "TRACE", LevelFatal: "FATAL", }
LevelNames contains a list of custom log level names.
Functions ¶
func StartProfiling ¶
func StartProfiling(logger *slog.Logger, flags ProfileFlags) error
func StopProfiling ¶
func StopProfiling(logger *slog.Logger, flags ProfileFlags) error
Types ¶
type Options ¶
type Options struct {
LogLevel string `env:"FORAGD_LOGLEVEL" name:"log-level" enum:"info,debug,trace" default:"info" help:"Set logging level."`
NoLogFile bool `env:"FORAGD_NOLOGFILE" name:"no-log-file" default:"false" help:"Don't write to a log file."`
}
Options are options for controlling logging.
type ProfileFlags ¶
Click to show internal directories.
Click to hide internal directories.