logger

package
v0.0.0-...-9ea7be0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGroup = "API"

DefaultGroup - name to use, usually logs go here, except for things like quant jobs where we want to track the workings of an individual job

Variables

This section is empty.

Functions

This section is empty.

Types

type ILogger

type ILogger interface {
	Printf(level LogLevel, format string, a ...interface{})
	Debugf(format string, a ...interface{})
	Infof(format string, a ...interface{})
	Errorf(format string, a ...interface{})
}

ILogger - Generic logger interface

type LogLevel

type LogLevel int

LogLevel - log level type

const (

	// LogDebug - DEBUG log level
	LogDebug LogLevel = iota

	// LogInfo - INFO log level
	LogInfo LogLevel = iota

	// LogError - ERROR log level (does not call os.Exit!)
	LogError LogLevel = iota
)

type Logger

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

Logger - Structure holding API logger internals

func Init

func Init(logGroupName string, logLevel LogLevel, environmentName string, sess *session.Session) (Logger, error)

Init - initialises the logger, given settings and AWS session

func (Logger) Debugf

func (l Logger) Debugf(format string, a ...interface{})

Debugf - Print debug to log, with format string

func (Logger) Errorf

func (l Logger) Errorf(format string, a ...interface{})

Errorf - Print error to log, with format string

func (Logger) Infof

func (l Logger) Infof(format string, a ...interface{})

Infof - Print info to log, with format string

func (Logger) Printf

func (l Logger) Printf(level LogLevel, format string, a ...interface{})

Printf - Print to log, with format string and log level

type NullLogger

type NullLogger struct {
}

NullLogger - For mocking out in tests

func (NullLogger) Debugf

func (l NullLogger) Debugf(format string, a ...interface{})

func (NullLogger) Errorf

func (l NullLogger) Errorf(format string, a ...interface{})

func (NullLogger) Infof

func (l NullLogger) Infof(format string, a ...interface{})

func (NullLogger) Printf

func (l NullLogger) Printf(level LogLevel, format string, a ...interface{})

type StdOutLogger

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

StdOutLogger - For mocking out in tests

func (StdOutLogger) Debugf

func (l StdOutLogger) Debugf(format string, a ...interface{})

func (StdOutLogger) Errorf

func (l StdOutLogger) Errorf(format string, a ...interface{})

func (StdOutLogger) Infof

func (l StdOutLogger) Infof(format string, a ...interface{})

func (StdOutLogger) Printf

func (l StdOutLogger) Printf(level LogLevel, format string, a ...interface{})

Jump to

Keyboard shortcuts

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