gepis_common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LogTypeLog     = "log"
	LogTypeRequest = "request"
)

Variables

This section is empty.

Functions

func ApplyOptionsToLoggers

func ApplyOptionsToLoggers(options *Options) error

Types

type LogLevel

type LogLevel string
const (
	DebugLevel     LogLevel = "debug"
	InfoLevel      LogLevel = "info"
	WarnLevel      LogLevel = "warn"
	ErrorLevel     LogLevel = "error"
	FatalLevel     LogLevel = "fatal"
	UndefinedLevel LogLevel = "undefined"
)

type Logger

type Logger interface {
	EnableJSONOutput(enabled bool)
	SetAppID(id string)
	SetOutputLevel(outputLevel LogLevel)
	WithLogType(logType string) Logger
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
}

func NewLogger

func NewLogger(name string) Logger

type Options

type Options struct {
	JSONFormatEnabled bool
	OutputLevel       string
	// contains filtered or unexported fields
}

func DefaultOptions

func DefaultOptions() Options

func (*Options) AttachCmdFlags

func (o *Options) AttachCmdFlags(
	stringVar func(p *string, name string, value string, usage string),
	boolVar func(p *bool, name string, value bool, usage string))

func (*Options) SetAppID

func (o *Options) SetAppID(id string)

func (*Options) SetOutputLevel

func (o *Options) SetOutputLevel(outputLevel string) error

Jump to

Keyboard shortcuts

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