zap

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package zap provides a zap based logger we use in our servers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(level slog.LogLevel) slog.Logger

New creates a new slog.Logger wrapper for a zap.Logger using the given io.Writer and restricted to entries above the give slog.LogLevel threshold.

Types

type Config

type Config struct {
	// Level is the threshold for the created slog.Logger
	Level slog.LogLevel

	Config *zap.Config
}

Config describes how the Zap wrapper will be created

func (Config) New

func (c Config) New() slog.Logger

New creates a new slog.Logger from the Config.

func (*Config) SetLevel

func (c *Config) SetLevel(level slog.LogLevel)

SetLevel sets the threshold level for the created slog.Logger.

Jump to

Keyboard shortcuts

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