log

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Debug(ctx context.Context, message string, fields ...Field)
	Info(ctx context.Context, message string, fields ...Field)
	Notice(ctx context.Context, message string, fields ...Field)
	Warn(ctx context.Context, message string, fields ...Field)
	Error(ctx context.Context, message string, fields ...Field)
	Fatal(ctx context.Context, message string, fields ...Field)
}

func NewClient

func NewClient(ctx context.Context, config Config) Client

NewClient for logging

type Config added in v0.4.0

type Config struct {
	Env go_environment.Environment
}

type Field

type Field string

Field to log

func FmtAny

func FmtAny(value interface{}, name string) Field

FmtAny using JSON marshaller with indenting

Use this to format for logging any object that can be JSON unmarshalled Type and value will be logged If JSON unmarshalling fails, the value will not be logged

func FmtAnys

func FmtAnys(values []interface{}, name string) Field

FmtAnys using JSON marshaller with indenting

Use this to format for logging any object that can be JSON unmarshalled Type and value will be logged If JSON unmarshalling fails, the value will not be logged

func FmtBool

func FmtBool(value bool, name string) Field

FmtBool as name/value pair for logging

func FmtBools

func FmtBools(values []bool, name string) Field

FmtBools as name/[values] pair for logging

func FmtByte

func FmtByte(value byte, name string) Field

FmtByte as name/value pair for logging

func FmtBytes

func FmtBytes(value []byte, name string) Field

FmtBytes as name/value pair for logging

func FmtDuration

func FmtDuration(value time.Duration, name string) Field

FmtDuration as name/value pair for logging

func FmtDurations

func FmtDurations(values []time.Duration, name string) Field

FmtDurations as name/[values] pair for logging

func FmtError

func FmtError(err error) Field

FmtError as name/value pair for logging

func FmtFloat32

func FmtFloat32(value float32, name string) Field

FmtFloat32 as name/value pair for logging

func FmtFloat32s

func FmtFloat32s(values []float32, name string) Field

FmtFloat32s as name/[values] pair for logging

func FmtFloat64

func FmtFloat64(value float64, name string) Field

FmtFloat64 as name/value pair for logging

func FmtFloat64s

func FmtFloat64s(values []float64, name string) Field

FmtFloat64s as name/[values] pair for logging

func FmtInt

func FmtInt(value int, name string) Field

FmtInt as name/value pair for logging

func FmtInt32

func FmtInt32(value int32, name string) Field

FmtInt32 as name/value pair for logging

func FmtInt32s

func FmtInt32s(values []int32, name string) Field

FmtInt32s as name/[values] pair for logging

func FmtInt64

func FmtInt64(value int64, name string) Field

FmtInt64 as name/value pair for logging

func FmtInt64s

func FmtInt64s(values []int64, name string) Field

FmtInt64s as name/[values] pair for logging

func FmtInts

func FmtInts(values []int, name string) Field

FmtInts as name/[values] pair for logging

func FmtString

func FmtString(value string, name string) Field

FmtString as name/value pair for logging

func FmtStrings

func FmtStrings(values []string, name string) Field

FmtStrings as name/[values] pair for logging

func FmtTime

func FmtTime(value time.Time, name string) Field

FmtTime as name/value pair for logging

func FmtTimes

func FmtTimes(values []time.Time, name string) Field

FmtTimes as name/[values] pair for logging

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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