Documentation
¶
Index ¶
- Variables
- func CatchPanic(location string)
- func CatchPanicCallback(location string, cb func(err any))
- func Debug(template string, args ...interface{})
- func Error(template string, args ...interface{})
- func HandlePanic(methodName string, r any) error
- func Info(template string, args ...interface{})
- func Init(dev bool)
- func UpdateLogger(config *zap.Config)
- func UpdateLoggerPath(path string, dev bool)
- func Warn(template string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *zap.SugaredLogger
Functions ¶
func CatchPanicCallback ¶ added in v0.0.19
CatchPanic - Handle panic
func HandlePanic ¶ added in v0.0.49
HandlePanic logs a panic and returns it as an error This should be called with the result of recover() from a deferred function Example usage:
defer func() {
if r := recover(); r != nil {
err = logger.HandlePanic("MethodName", r)
}
}()
func UpdateLogger ¶
func UpdateLoggerPath ¶ added in v0.0.64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.