You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
1.6 KiB
101 lines
1.6 KiB
package log
|
|
|
|
import (
|
|
"io"
|
|
"time"
|
|
)
|
|
|
|
var std = New(&Options{Level: LevelTrace})
|
|
|
|
func Default() Logger { return std }
|
|
|
|
func Flags() int {
|
|
return std.Flags()
|
|
}
|
|
|
|
func SetFlags(flags int) {
|
|
std.SetFlags(flags)
|
|
}
|
|
|
|
func LevelMode() Level {
|
|
return std.Level()
|
|
}
|
|
|
|
func SetLevel(level Level) {
|
|
std.SetLevel(level)
|
|
}
|
|
|
|
func Timezone() *time.Location {
|
|
return std.Timezone()
|
|
}
|
|
|
|
func SetTimezone(loc *time.Location) {
|
|
std.SetTimezone(loc)
|
|
}
|
|
|
|
func IgnorePC() bool {
|
|
return std.IgnorePC()
|
|
}
|
|
|
|
func SetIgnorePC(ignore bool) {
|
|
std.SetIgnorePC(ignore)
|
|
}
|
|
|
|
func Enabled(level Level) bool {
|
|
return std.Enabled(level)
|
|
}
|
|
|
|
func SetWriter(w io.Writer) {
|
|
std.SetWriter(w)
|
|
}
|
|
|
|
func SetPersistWriter(w io.Writer) {
|
|
std.SetPersistWriter(w)
|
|
}
|
|
|
|
func With(attrs ...Attr) Logger {
|
|
return std.With(attrs...)
|
|
}
|
|
|
|
func WithGroup(name string) Logger {
|
|
return std.WithGroup(name)
|
|
}
|
|
|
|
// Log logs at level.
|
|
func Log(level Level, msg string, args ...any) {
|
|
std.Log(level, msg, args...)
|
|
}
|
|
|
|
// Trace logs at LevelTrace.
|
|
func Trace(msg string, args ...any) {
|
|
std.Trace(msg, args...)
|
|
}
|
|
|
|
// Debug logs at LevelDebug.
|
|
func Debug(msg string, args ...any) {
|
|
std.Debug(msg, args...)
|
|
}
|
|
|
|
// Info logs at LevelInfo.
|
|
func Info(msg string, args ...any) {
|
|
std.Info(msg, args...)
|
|
}
|
|
|
|
// Warn logs at LevelWarn.
|
|
func Warn(msg string, args ...any) {
|
|
std.Warn(msg, args...)
|
|
}
|
|
|
|
// Error logs at LevelError.
|
|
func Error(msg string, args ...any) {
|
|
std.Error(msg, args...)
|
|
}
|
|
|
|
func Panic(msg string, args ...any) {
|
|
std.Panic(msg, args...)
|
|
}
|
|
|
|
// Fatal logs at LevelFatal.
|
|
func Fatal(msg string, args ...any) {
|
|
std.Fatal(msg, args...)
|
|
}
|
|
|