log

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 14

Documentation

Overview

Package log provides generic interface and implementations for logging.

The log package's structures are self-initialized by fx and bootstrapper. Fields are populated via yaml values or env variables. Env variables overwrite yaml configuration.

Package log provides generic interface and implementations for logging.

The log package's structures are self-initialized by fx and bootstrapper. Fields are populated via yaml values or env variables. Env variables overwrite yaml configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

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

DefaultLogger is a golang log package Logger implementation.

func (DefaultLogger) Debug

func (l DefaultLogger) Debug(args ...interface{})

func (DefaultLogger) Debugf

func (l DefaultLogger) Debugf(format string, args ...interface{})

func (DefaultLogger) Error

func (l DefaultLogger) Error(args ...interface{})

func (DefaultLogger) Errorf

func (l DefaultLogger) Errorf(format string, args ...interface{})

func (DefaultLogger) Fatal

func (l DefaultLogger) Fatal(args ...interface{})

func (DefaultLogger) Fatalf

func (l DefaultLogger) Fatalf(format string, args ...interface{})

func (DefaultLogger) Info

func (l DefaultLogger) Info(args ...interface{})

func (DefaultLogger) Infof

func (l DefaultLogger) Infof(format string, args ...interface{})

func (DefaultLogger) Warn

func (l DefaultLogger) Warn(args ...interface{})

func (DefaultLogger) Warnf

func (l DefaultLogger) Warnf(format string, args ...interface{})

type EmptyLogger

type EmptyLogger struct{}

EmptyLogger is an empty Logger implementation.

func (EmptyLogger) Debug

func (l EmptyLogger) Debug(args ...interface{})

func (EmptyLogger) Debugf

func (l EmptyLogger) Debugf(format string, args ...interface{})

func (EmptyLogger) Error

func (l EmptyLogger) Error(args ...interface{})

func (EmptyLogger) Errorf

func (l EmptyLogger) Errorf(format string, args ...interface{})

func (EmptyLogger) Fatal

func (l EmptyLogger) Fatal(args ...interface{})

func (EmptyLogger) Fatalf

func (l EmptyLogger) Fatalf(format string, args ...interface{})

func (EmptyLogger) Info

func (l EmptyLogger) Info(args ...interface{})

func (EmptyLogger) Infof

func (l EmptyLogger) Infof(format string, args ...interface{})

func (EmptyLogger) Warn

func (l EmptyLogger) Warn(args ...interface{})

func (EmptyLogger) Warnf

func (l EmptyLogger) Warnf(format string, args ...interface{})

type LogElasticInitializationError

type LogElasticInitializationError struct {
	Address string
	Cause   error
}

LogElasticInitializationError fires when an elastic client throws an error.

func (*LogElasticInitializationError) Error

type LogFileInitializationError

type LogFileInitializationError struct {
	Path  string
	Cause error
}

LogFileInitializationError fires if Lumberjack throws an error.

func (*LogFileInitializationError) Error

type LogLevel

type LogLevel int

Logging level type

const (
	LEVEL_TRACE   LogLevel = 1
	LEVEL_DEBUG   LogLevel = 2
	LEVEL_INFO    LogLevel = 3
	LEVEL_WARNING LogLevel = 4
	LEVEL_ERROR   LogLevel = 5
	LEVEL_FATAL   LogLevel = 6
)

type Logger

type Logger interface {
	// Writes a debug message with a specific format.
	Debugf(format string, args ...interface{})
	// Writes an info message with a specific format.
	Infof(format string, args ...interface{})
	// Writes a warning message with a specific format.
	Warnf(format string, args ...interface{})
	// Writes an error message with a specific format.
	Errorf(format string, args ...interface{})
	// Writes a fatal message with a specific format.
	Fatalf(format string, args ...interface{})
	// Writes a debug message.
	Debug(args ...interface{})
	// Writes an info message.
	Info(args ...interface{})
	// Writes a warning message.
	Warn(args ...interface{})
	// Writes an error message.
	Error(args ...interface{})
	// Writes a fatal message.
	Fatal(args ...interface{})
}

Logger is a generic logger interface.

func NewDefaultLogger

func NewDefaultLogger(config *config.LoggerConfig) Logger

NewDefaultLogger is a golang log package Logger constructor.

func NewEmptyLogger

func NewEmptyLogger() Logger

NewEmptyLogger is an empty logger constructor.

func NewLogrusLogger

func NewLogrusLogger(config *config.LoggerConfig) (Logger, error)

NewLogrusLogger creates a new logger compliant with the Logger interface.

type LogrusLogger

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

LogrusLogger is a logrus logger wrapper.

func (LogrusLogger) Debug

func (l LogrusLogger) Debug(args ...interface{})

func (LogrusLogger) Debugf

func (l LogrusLogger) Debugf(format string, args ...interface{})

func (LogrusLogger) Error

func (l LogrusLogger) Error(args ...interface{})

func (LogrusLogger) Errorf

func (l LogrusLogger) Errorf(format string, args ...interface{})

func (LogrusLogger) Fatal

func (l LogrusLogger) Fatal(args ...interface{})

func (LogrusLogger) Fatalf

func (l LogrusLogger) Fatalf(format string, args ...interface{})

func (LogrusLogger) Info

func (l LogrusLogger) Info(args ...interface{})

func (LogrusLogger) Infof

func (l LogrusLogger) Infof(format string, args ...interface{})

func (LogrusLogger) Warn

func (l LogrusLogger) Warn(args ...interface{})

func (LogrusLogger) Warnf

func (l LogrusLogger) Warnf(format string, args ...interface{})

Directories

Path Synopsis
Package hook provides logging hooks.
Package hook provides logging hooks.

Jump to

Keyboard shortcuts

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