logging

package
v0.0.0-...-5a5e713 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

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

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

func NewZapLogger(preset string, level zapcore.Level) (*zap.Logger, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL