This repository has been archived on 2024-07-20. You can view files and clone it, but cannot push or open issues or pull requests.
logger/log/log.go

69 lines
1.7 KiB
Go
Raw Normal View History

2022-06-30 10:07:29 +00:00
package log
import (
2022-06-30 20:41:55 +00:00
"go.arsenm.dev/logger"
2022-06-30 10:07:29 +00:00
"os"
)
var Logger logger.Logger = logger.NewJSON(os.Stderr)
// NoPanic prevents the logger from panicking on panic events
func NoPanic() {
Logger.NoPanic()
}
// NoExit prevents the logger from exiting on fatal events
func NoExit() {
Logger.NoExit()
}
// Debug creates a new debug event with the given message
func Debug(msg string) logger.LogBuilder {
return Logger.Debug(msg)
}
// Debugf creates a new debug event with the formatted message
func Debugf(format string, v ...any) logger.LogBuilder {
return Logger.Debugf(format, v...)
}
// Info creates a new info event with the given message
func Info(msg string) logger.LogBuilder {
return Logger.Info(msg)
}
// Infof creates a new info event with the formatted message
func Infof(format string, v ...any) logger.LogBuilder {
return Logger.Infof(format, v...)
}
// Warn creates a new warn event with the given message
func Warn(msg string) logger.LogBuilder {
return Logger.Warn(msg)
}
// Warnf creates a new warn event with the formatted message
func Warnf(format string, v ...any) logger.LogBuilder {
return Logger.Warnf(format, v...)
}
// Error creates a new error event with the given message
func Error(msg string) logger.LogBuilder {
return Logger.Error(msg)
}
// Errorf creates a new error event with the formatted message
func Errorf(format string, v ...any) logger.LogBuilder {
return Logger.Errorf(format, v...)
}
2022-10-07 03:23:43 +00:00
// Fatal creates a new fatal event with the given message
func Fatal(msg string) logger.LogBuilder {
return Logger.Fatal(msg)
}
// Fatalf creates a new fatal event with the formatted message
func Fatalf(format string, v ...any) logger.LogBuilder {
return Logger.Fatalf(format, v...)
}