Documentation ¶
Overview ¶
Package zap provides an implementation for the golangee/log facade. It also provides an automatic configure method, which detects automatically if the development or production logger must be used.
Index ¶
- func Configure()
- func IsDevelopment() bool
- type LogAdapter
- func (l LogAdapter) Debug(msg string, fields ...log.Field)
- func (l LogAdapter) Error(msg string, fields ...log.Field)
- func (l LogAdapter) Fatal(msg string, fields ...log.Field)
- func (l LogAdapter) Info(msg string, fields ...log.Field)
- func (l LogAdapter) Panic(msg string, fields ...log.Field)
- func (l LogAdapter) Trace(msg string, fields ...log.Field)
- func (l LogAdapter) Unwrap() *zap.Logger
- func (l LogAdapter) Warn(msg string, fields ...log.Field)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
func Configure()
Configure initializes the uber zap logger to be used with the golangee/log package. See also #IsDevelopment().
func IsDevelopment ¶
func IsDevelopment() bool
IsDevelopment evaluates the following sources:
- if any _INTELLIJ_* environment variable is defined, returns true
- XPC_SERVICE_NAME contains goland
- if APP_ENV or NODE_ENV environment variable is set to 'production' returns false, otherwise if specified at all returns true
- if any VSCODE_* environment variable is defined, returns true
- otherwise returns false
Types ¶
type LogAdapter ¶
type LogAdapter struct {
// contains filtered or unexported fields
}
LogAdapter is a delegating implementation of golangee/log#Logger.
func NewLogAdapter ¶
func NewLogAdapter(delegate *zap.Logger) LogAdapter
NewLogAdapter creates a new logger
func (LogAdapter) Unwrap ¶
func (l LogAdapter) Unwrap() *zap.Logger
Click to show internal directories.
Click to hide internal directories.