log

package
v0.0.0-...-c2c101f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIdKeyString string = "GrpcRequestUniqueId"

Variables

This section is empty.

Functions

func RequestIdFromContext

func RequestIdFromContext(ctx context.Context) string

To avoid looped dependency. api.RequestIdFromContext() requires RequestContext, while RequestContext depends on meta package.

Types

type Level

type Level int
const (
	ErrorLevel Level = 0 // Errors should be properly handled
	WarnLevel  Level = 1 // Errors could be ignored; messages might need noticed
	InfoLevel  Level = 2 // Informational messages
)

func ParseLevel

func ParseLevel(levelString string) Level

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewFileLogger

func NewFileLogger(path string, logLevel Level) Logger

func NewLogger

func NewLogger(out io.WriteCloser, logLevel Level) Logger

func (Logger) Close

func (l Logger) Close() error

func (Logger) Error

func (l Logger) Error(ctx context.Context, args ...interface{})

func (Logger) Info

func (l Logger) Info(ctx context.Context, args ...interface{})

func (Logger) NewWithRequestID

func (l Logger) NewWithRequestID(requestID string) Logger

func (Logger) Println

func (l Logger) Println(args ...interface{})

Write a new line with args. Unless you really want to customize output format, use "Info", "Warn", "Error" instead

func (Logger) Warn

func (l Logger) Warn(ctx context.Context, args ...interface{})

Jump to

Keyboard shortcuts

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