log

package
v0.0.1-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package log implements logging functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr(addr net.Addr) zap.Field

Addr is shorthand for zap.String("addr", addr.String()).

func Data

func Data(v []byte) zap.Field

Data is shorthand for zap.ByteString("data", v).

func FromContext

func FromContext(ctx context.Context) *zap.Logger

FromContext returns the Logger the given Context carries.

FromContext panics in case the given Context carries no Logger.

func IP

func IP(ip net.IP) zap.Field

IP is shorthand for zap.String("ip", ip.String()).

func New

func New(name string) *zap.Logger

New returns a reference to a Logger with the given name.

func NewContext

func NewContext(ctx context.Context, logger *zap.Logger) context.Context

NewContext returns a copy of ctx which carries logger.

func Port

func Port(port int) zap.Field

Port is shorthand for zap.Int("port", port).

Types

This section is empty.

Jump to

Keyboard shortcuts

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