log

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 9 Imported by: 1

README

Koinos Log Golang

A logging library used by Koinos applications

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// GetPool retrieves a buffer from the pool, creating one if necessary.
	GetPool = _pool.Get
)

Functions

func Debug

func Debug(msg string)

Debug logs to the debug level

func Debugf

func Debugf(template string, args ...interface{})

Debugf logs to the debug level with a format string and associated parameters

func Error

func Error(msg string)

Error logs to the error level

func Errorf

func Errorf(template string, args ...interface{})

Errorf logs to the error level with a format string and associated parameters

func Info

func Info(msg string)

Info logs to the info level

func Infof

func Infof(template string, args ...interface{})

Infof logs to the info level with a format string and associated parameters

func InitLogger

func InitLogger(level string, jsonFileOutput bool, logFilename string, appID string) error

InitLogger initializes the logger with the given parameters

func KoinosColorLevelEncoder

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

KoinosColorLevelEncoder implements the Koinos log level color encoding standard

func KoinosTimeEncoder

func KoinosTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

KoinosTimeEncoder encodes timestamps in the Koinos human-readable log standard

func NewKoinosEncoder

func NewKoinosEncoder(cfg zapcore.EncoderConfig, appID string) zapcore.Encoder

NewKoinosEncoder creates and returns a new instance of KoinosEncoder

func Warn

func Warn(msg string)

Warn logs to the warn level

func Warnf

func Warnf(template string, args ...interface{})

Warnf logs to the warn level with a format string and associated parameters

Types

type KoinosEncoder

type KoinosEncoder struct {
	*zapcore.MapObjectEncoder
	*zapcore.EncoderConfig
	ConsoleSeparator string
	AppID            string
}

KoinosEncoder implements custon koinos log formatting

func (*KoinosEncoder) Clone

func (ke *KoinosEncoder) Clone() zapcore.Encoder

Clone clones KoinosEncoder

func (*KoinosEncoder) EncodeEntry

func (ke *KoinosEncoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)

EncodeEntry encodes the given entry data

Jump to

Keyboard shortcuts

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