log

package
v1.0.0-beta.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CE

func CE(format string, args ...interface{}) error

CE is a helper to shortcut error creation and logging Used like this:

return CE("msg, value %v", value)

to replace:

err := fmt.Errorf("msg, value %v", value) log.Msgf("msg, value %v", value) return err.

func Configure

func Configure(config LogConfig)

Configure default logger.

func E

func E(err error) bool

E is a helper function to shortcut condition checking and logging in the case of error Used like this:

if E(err) {
    return err
}

to replace:

if err != nil {
    log.Msgf(err.Error())
    return err
}

Types

type LogConfig

type LogConfig struct {
	Level      string
	Format     string
	SampleRate float64 `mapstructure:"sample_rate" yaml:"sample_rate" json:"sample_rate"`
}

Jump to

Keyboard shortcuts

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