zap

package module
v2.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 10

Documentation

Overview

Package zap provides a small adapter required to use zap in logging gRPC middlewares. Please see examples for examples of use.

Example (InitializationWithCustomLevels)
Output:

Example (InitializationWithDurationFieldOverride)
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.Logger
}

Logger is a zap logging adapter compatible with logging middlewares.

func InterceptorLogger

func InterceptorLogger(logger *zap.Logger) *Logger

InterceptorLogger converts zap logger to Logger adapter.

func (*Logger) Log

func (l *Logger) Log(lvl logging.Level, msg string)

Log implements logging.Logger interface.

func (*Logger) With

func (l *Logger) With(fields ...string) logging.Logger

With implements logging.Logger interface.

Jump to

Keyboard shortcuts

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