Documentation
¶
Index ¶
- Variables
- func CatchPanic(location string, args ...interface{}) func()
- func CatchPanicCallback(location string, cb func(err any), args ...interface{}) func()
- func CloseErrorTracking() error
- func Debug(template string, args ...interface{})
- func Error(template string, args ...interface{})
- func GetErrorTracker() errortracking.Provider
- func HandlePanic(methodName string, r any, args ...interface{}) error
- func Info(template string, args ...interface{})
- func Init(dev bool)
- func InitErrorTracking(provider errortracking.Provider)
- 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 CatchPanic ¶ added in v0.0.19
func CatchPanic(location string, args ...interface{}) func()
CatchPanic - Handle panic Returns a function that should be deferred to catch panics Example usage: defer CatchPanic("MyFunction")()
func CatchPanicCallback ¶ added in v0.0.19
CatchPanic - Handle panic Returns a function that should be deferred to catch panics Example usage: defer CatchPanicCallback("MyFunction", func(err any) { /* cleanup */ })()
func CloseErrorTracking ¶ added in v0.0.98
func CloseErrorTracking() error
CloseErrorTracking flushes and closes the error tracking provider
func GetErrorTracker ¶ added in v0.0.98
func GetErrorTracker() errortracking.Provider
GetErrorTracker returns the current error tracking provider
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 InitErrorTracking ¶ added in v0.0.98
func InitErrorTracking(provider errortracking.Provider)
InitErrorTracking initializes the error tracking provider
func UpdateLogger ¶
func UpdateLoggerPath ¶ added in v0.0.64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.