logger

package
v0.0.0-...-3b46a80 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogLevel

func GetLogLevel() string

GetLogLevel returns the log level

func GetLogLocation

func GetLogLocation() string

GetLogLocation returns the log file path

Types

type Configuration

type Configuration struct {
	LogLevel    string
	LogLocation string
}

Configuration stores the config for the logger

func LoadLogConfig

func LoadLogConfig() *Configuration

LoadLogConfig returns the log configuration

type Fields

type Fields map[string]interface{}

Fields Type to pass when we want to call WithFields for structured logging

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})

	Debug(format string)

	Infof(format string, args ...interface{})

	Info(format string)

	Warnf(format string, args ...interface{})

	Warn(format string)

	Errorf(format string, args ...interface{})

	Error(format string)

	Fatalf(format string, args ...interface{})

	Panicf(format string, args ...interface{})

	WithFields(keyValues Fields) Logger
}

Logger is our contract for the logger

func DefaultLogger

func DefaultLogger() Logger

DefaultLogger creates and returns a new default logger.

func Get

func Get() Logger

Get returns an default instance of the zap logger

func New

func New(inputLogConfig *Configuration) Logger

New logger initializes logger

Jump to

Keyboard shortcuts

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