Documentation
¶
Overview ¶
Package logging record log with zap and sentry without complex config
use SetConfig before first Logger call, default to zap.NewDevelopmentConfig.
call Sync before program exit, it will call Sync method for underlying zap cores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConsoleLevel = zapcore.InfoLevel
ConsoleLevel for console log.
logger that name is DebugLoggerName will be debug level.
View Source
var DebugLoggerName = os.Getenv("DEBUG")
DebugLoggerName specify console debug logger by name.
View Source
var (
// HubContextKey used to store logging hub
HubContextKey = &contextKey{}
)
View Source
var SentryLevel = zapcore.WarnLevel
SentryLevel for sentry log.
Functions ¶
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub for zap and sentry
func For ¶
For returns hub for given context, will use background hub if not set on context or context is nil.
Use `With` if you are going modify sentry scope, so they don't mixed up between goroutine.
Click to show internal directories.
Click to hide internal directories.