Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProductionConsoleEncoderConfig ¶
func NewProductionConsoleEncoderConfig(noColor, noTime bool) zapcore.EncoderConfig
NewProductionConsoleEncoderConfig returns an opinionated zapcore.EncoderConfig for production console environments.
func NewProductionConsoleZapLogger ¶ added in v1.11.0
func NewProductionConsoleZapLogger(level zapcore.Level, noColor, noTime, addCaller bool) *zap.Logger
NewProductionConsoleZapLogger creates a new *zap.Logger with reasonable defaults for production console environments.
See NewProductionConsoleEncoderConfig for information on the default encoder configuration.
func NewZapLogger ¶ added in v1.11.0
NewZapLogger returns a new *zap.Logger with the given preset and log level.
The available presets are:
- "console" (default): Reasonable defaults for production console environments.
- "console-nocolor": Same as "console", but without color.
- "console-notime": Same as "console", but without timestamps.
- "systemd": Reasonable defaults for running as a systemd service. Same as "console", but without color and timestamps.
- "production": Zap's built-in production preset.
- "development": Zap's built-in development preset.
If the preset is not recognized, it is treated as a path to a JSON configuration file.
The log level does not apply to the "production", "development", or custom presets.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.