logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package logger defines an interface for logging with various levels and methods for structured logging, including Info, Warn, Error, Fatal, and Panic, as well as options for attaching fields and handling panics, along with methods for flushing and closing the logger.

Index

Constants

View Source
const (
	LevelInfo = iota
	LevelWarn
	LevelError
	LevelPanic
	LevelFatal
)

Variables

This section is empty.

Functions

This section is empty.

Types

type F

type F = Fields

type Fields

type Fields map[string]interface{}

type L

type L = Labels

type Labels

type Labels map[string]string

func (Labels) Add

func (l Labels) Add(labels Labels) Labels

Add adds new and overwrites existing keys.

func (Labels) Clone

func (l Labels) Clone() Labels

Clone deep copy.

func (Labels) Del

func (l Labels) Del(keys ...string) Labels

Del deletes keys.

type Level

type Level int8

type Log

type Log interface {
	Info(msg string)

	Infow(msg string, fields Fields)

	Warn(msg string)

	Warnw(msg string, fields Fields)

	Error(msg string, code uint64)

	Errorw(msg string, code uint64, fields Fields)

	Fatal(msg string, code uint64)

	Fatalw(msg string, code uint64, fields Fields)

	Panic(msg string, code uint64)

	Panicw(msg string, code uint64, fields Fields)

	PanicLogger()

	Flush()

	Close()
}

Jump to

Keyboard shortcuts

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