{"modulePath":"github.com/swithek/httpflow","version":"v0.0.0-20210302114855-3975a26f6022","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package logutil\n\nPackage logutil provides helper functions for more convenient logging and error tracking.\n\n## Functions\n\n```go\nfunc Critical(log zerolog.Logger, err error) *zerolog.Event\n```\nCritical creates an error level log event and sends the error to the remote error tracking service.\n\n```go\nfunc Recover(log zerolog.Logger, msg string, extra map[string]interface{}, fn func())\n```\nRecover handles recoveries from panics, sends their info to the remote error tracking service and logs them locally. If no panic occurs, nothing will be logged / sent. Map parameter provides additional key-value pairs to include in the log entry (not the remote error tracking event). It can be nil. Function type parameter is called right before message printing. It can be nil. Example: \\`defer logutil.Recover(log, \"cannot continue\", map\\[string]interface{\"request\\_id\": \"id123\"}, cleanupFn)\\`. or \\`defer logutil.Recover(log, \"cannot continue\", nil, nil)\\`.\n\n","path":"github.com/swithek/httpflow/logutil","name":"logutil","synopsis":"Package logutil provides helper functions for more convenient logging and error tracking.","isRedistributable":true}
