{"modulePath":"github.com/bitechdev/ResolveSpec","version":"v1.3.14","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package logger\n\n## Variables\n\n```go\nvar Logger *zap.SugaredLogger\n```\nLogger is the active logger. It is kept exported for compatibility, but inside this package it must only be accessed through getLogger/setLogger.\n\n## Functions\n\n```go\nfunc CatchPanic(location string, args ...interface{}) func()\n```\nCatchPanic - Handle panic Returns a function that should be deferred to catch panics Example usage: defer CatchPanic(\"MyFunction\")()\n\n```go\nfunc CatchPanicCallback(location string, cb func(err any), args ...interface{}) func()\n```\nCatchPanic - Handle panic Returns a function that should be deferred to catch panics Example usage: defer CatchPanicCallback(\"MyFunction\", func(err any) { /\\* cleanup \\*/ })()\n\n```go\nfunc CatchPanicRethrow(location string, args ...interface{}) func()\n```\nCatchPanicRethrow returns a function to defer that logs and reports a panic and then re-panics. Use it inside enforcement/internal code where swallowing the panic would let the caller proceed as if the work had succeeded. The swallowing CatchPanic is for outermost request/goroutine boundaries only.\n\n```go\nfunc CloseErrorTracking() error\n```\nCloseErrorTracking flushes and closes the error tracking provider\n\n```go\nfunc Debug(template string, args ...interface{})\n```\n\n```go\nfunc Error(template string, args ...interface{})\n```\n\n```go\nfunc GetErrorTracker() errortracking.Provider\n```\nGetErrorTracker returns the current error tracking provider\n\n```go\nfunc HandlePanic(methodName string, r any, args ...interface{}) error\n```\nHandlePanic logs a panic and returns it as an error This should be called with the result of recover() from a deferred function Example usage:\n\n\tdefer func() {\n\t    if r := recover(); r != nil {\n\t        err = logger.HandlePanic(\"MethodName\", r)\n\t    }\n\t}()\n\n```go\nfunc Info(template string, args ...interface{})\n```\n\n```go\nfunc Init(dev bool)\n```\n\n```go\nfunc InitErrorTracking(provider errortracking.Provider)\n```\nInitErrorTracking initializes the error tracking provider\n\n```go\nfunc Sync() error\n```\nSync flushes buffered log entries. Call it on shutdown.\n\n```go\nfunc UpdateLogger(config *zap.Config)\n```\nUpdateLogger rebuilds the logger from config. On failure the previous logger stays in place; use UpdateLoggerE to get the error.\n\n```go\nfunc UpdateLoggerE(config *zap.Config) error\n```\nUpdateLoggerE is UpdateLogger but returns the build error.\n\n```go\nfunc UpdateLoggerPath(path string, dev bool)\n```\n\n```go\nfunc Warn(template string, args ...interface{})\n```\n\n","path":"github.com/bitechdev/ResolveSpec/pkg/logger","name":"logger","synopsis":"","isRedistributable":true}
