log

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

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevel = "RASPBERRY_LOGLEVEL"
	Error    = "error"
	Warn     = "warn"
	Debug    = "debug"
)

Defines for consitants about log

Variables

This section is empty.

Functions

func Get

func Get() *logrus.Logger

Get gets log that extend capabilities, e.g. translations Config supported by os env params `RASPBERRY_LOGLEVEL`

func GetRaw

func GetRaw() *logrus.Logger

GetRaw gets rawLog, stand-in of standard logrus.Logger

func LoadTranslations

func LoadTranslations(thing map[string]interface{})

LoadTranslations takes a map[string]interface and flattens it to map[string]string Because translations have been loaded - we internally override log the formatter Nested entries are accessible using dot notation. example: `{"foo": {"bar": "baz"}}` flattened: `foo.bar: baz`

Types

type FlatMap

type FlatMap map[string]string

FlatMap is alias of map[string]string

func Flatten

func Flatten(data map[string]interface{}) (flatmap FlatMap, err error)

Flatten transform complex map to flatten map

type RawFormatter

type RawFormatter struct{}

RawFormatter defines that does not extends any capabilities.

func (*RawFormatter) Format

func (f *RawFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format override Format function of TextFormatter for RawFormatter.

type TranslationFormatter

type TranslationFormatter struct {
	*prefixed.TextFormatter
}

TranslationFormatter defines that extends capabilities of TextFormartter.

func (*TranslationFormatter) Format

func (t *TranslationFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format override Format function of TextFormatter for TranslationFormatter.

Jump to

Keyboard shortcuts

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