logger

package
Version: v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 30

Documentation

Overview

Package logger is the CNI Logger interface, using zap

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogLevel added in v1.6.4

func GetLogLevel() string

GetLogLevel returns the log level

func GetLogLocation added in v1.7.0

func GetLogLocation() string

GetLogLocation returns the log file path

Types

type Configuration added in v1.6.1

type Configuration struct {
	LogLevel    string
	LogLocation string
}

Configuration stores the config for the logger

func LoadLogConfig added in v1.6.1

func LoadLogConfig() *Configuration

LoadLogConfig returns the log configuration

type Fields added in v1.6.1

type Fields map[string]interface{}

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

type Logger added in v1.6.1

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 added in v1.6.1

func DefaultLogger() Logger

DefaultLogger creates and returns a new default logger.

func Get added in v1.6.1

func Get() Logger

Get returns an default instance of the zap logger

func New added in v1.6.1

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