Documentation
¶
Index ¶
- Constants
- func AttrsFrom(ctx context.Context) []slog.Attr
- func Err(err error) slog.Attr
- func Fanout(hs ...slog.Handler) slog.Handler
- func LevelName(l slog.Level) string
- func NewConsoleHandler(w io.Writer, app string, min slog.Leveler, color bool) slog.Handler
- func NewContextHandler(next slog.Handler) slog.Handler
- func NewJSONHandler(w io.Writer, app string, min slog.Leveler) slog.Handler
- func ParseLevel(s string) (slog.Level, error)
- func WithAttrs(ctx context.Context, attrs ...slog.Attr) context.Context
- type Config
- type DailyFile
- type DailyFileOptions
- type Logger
Constants ¶
View Source
const ( LevelVerbose = slog.Level(-8) LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError )
Variables ¶
This section is empty.
Functions ¶
func NewConsoleHandler ¶
Types ¶
type Config ¶
type Config struct {
LogDirectory string `json:"logDirectory"`
ZippedArchive bool `json:"zippedArchive"`
MinimumLogLevel string `json:"minimumLogLevel" validate:"omitempty,oneof=error warn info debug verbose"`
LogToFile bool `json:"logToFile"`
LogToConsole bool `json:"logToConsole"`
MaxFiles int `json:"maxFiles" validate:"min=0"`
ConsoleColor *bool `json:"consoleColor,omitempty"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type DailyFile ¶
type DailyFile struct {
// contains filtered or unexported fields
}
func NewDailyFile ¶
func NewDailyFile(o DailyFileOptions) (*DailyFile, error)
type DailyFileOptions ¶
Click to show internal directories.
Click to hide internal directories.