gologger

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 4 Imported by: 0

README

Gologger

Logging wrapper for golang. Wraps zap for simpler use and to be able to change the logger under the hood.

Adapters

The logger can be adapted for usage in:

  • mautrix/crypto

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int

LogLevel defines the log level

const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelError
)

type Logger

type Logger interface {
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Errorf(format string, args ...any)
	Err(err error)

	WithField(name string, value any) Logger
	WithFields(map[string]any) Logger

	Flush() error
}

Logger offers a simple to use logger interface.

func New

func New(loglevel LogLevel, skipCallers int) Logger

New assembles a new logger with the given log level. "skipCallers" defines how many callers are skipped in the hierarchy for displaying the caller.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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