logging

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogsHook = func(level common.LogLevel) {}

todo fix

Functions

func CustomCallerEncoder

func CustomCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)

CustomCallerEncoder ...

func CustomLevelEncoder

func CustomLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)

CustomLevelEncoder ...

func CustomNameEncoder

func CustomNameEncoder(v string, enc zapcore.PrimitiveArrayEncoder)

TODO fix

Types

type Color

type Color uint8

Color represents a text color.

const (
	// Black ...
	Black Color = iota + 30
	// Red ...
	Red
	// Green ...
	Green
	// Yellow ...
	Yellow
	// Blue ...
	Blue
	// Magenta ...
	Magenta
	// Cyan ...
	Cyan
	// White ...
	White
)

Foreground colors.

func (Color) Add

func (c Color) Add(s string) string

Add adds the coloring to the given string.

type Config

type Config struct {
	ColoredLogging bool
}

type ISaver

type ISaver interface {
	Save(log m.Log)
}

ISaver ...

type Logging

type Logging struct {
	// contains filtered or unexported fields
}

Logging ...

func NewLogger

func NewLogger(cfg *Config) (logging *Logging)

NewLogger ...

func (*Logging) SetDbSaver

func (b *Logging) SetDbSaver(saver ISaver)

SetDbSaver ...

func (*Logging) SetWsSaver

func (b *Logging) SetWsSaver(saver ISaver)

SetWsSaver ...

Jump to

Keyboard shortcuts

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