logger

package
v2.2.15+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: Apache-2.0 Imports: 3 Imported by: 36

Documentation

Overview

Package logger provides support for logging to stdout and stderr.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLevel

func CheckLevel(level string) error

CheckLevel checks whether the log level is valid.

func Debugf

func Debugf(ctx context.Context, format string, v ...interface{})

Debugf logs a message with severity DEBUG.

func Errorf

func Errorf(ctx context.Context, format string, v ...interface{})

Errorf logs a message with severity ERROR.

func Fatalf

func Fatalf(ctx context.Context, format string, v ...interface{})

Fatalf logs a message with severity ERROR followed by a call to os.Exit().

func GetLevel

func GetLevel() string

GetLevel get the log level string.

func Infof

func Infof(ctx context.Context, format string, v ...interface{})

Infof logs a message with severity INFO.

func SetLevel

func SetLevel(level string)

SetLevel sets the log level. Valid levels are "debug", "info", "warn", "error", and "fatal".

func SetLogger

func SetLogger(l Logger)

SetLogger sets the a logger as SDK logger.

func Warnf

func Warnf(ctx context.Context, format string, v ...interface{})

Warnf logs a message with severity WARN.

Types

type Logger

type Logger interface {
	Debugf(ctx context.Context, format string, v ...interface{})
	Infof(ctx context.Context, format string, v ...interface{})
	Warnf(ctx context.Context, format string, v ...interface{})
	Errorf(ctx context.Context, format string, v ...interface{})
	Fatalf(ctx context.Context, format string, v ...interface{})
	Panicf(ctx context.Context, format string, v ...interface{})
}

Logger is the interface of SDK logger.

Jump to

Keyboard shortcuts

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