glog

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GLog

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

GLog is a logger implementation

func New

func New() *GLog

New return a new logger It will lookup configuration from environment variables for initialization LOG_FORMAT can be text/json LOG_OUTPUT can be a file by setting value to file:///path/to/logfile if LOG_OUTPUT is different to a file, it will be redirect to os.Stdout.

func (*GLog) Close

func (l *GLog) Close() error

Close close the underlying writer

func (*GLog) Debug

func (l *GLog) Debug(format string)

Debug print debug with format.

func (*GLog) Debugc

func (l *GLog) Debugc(ctx context.Context, format string)

Debugc print debug with context

func (*GLog) Debugcf

func (l *GLog) Debugcf(ctx context.Context, format string, v ...interface{})

Debugcf print debug with context

func (*GLog) Debugf

func (l *GLog) Debugf(format string, v ...interface{})

Debugf print debug with format.

func (*GLog) Error

func (l *GLog) Error(format string)

Error print error with format.

func (*GLog) Errorc

func (l *GLog) Errorc(ctx context.Context, format string)

Errorc print error with context

func (*GLog) Errorcf

func (l *GLog) Errorcf(ctx context.Context, format string, v ...interface{})

Errorcf print error with context

func (*GLog) Errorf

func (l *GLog) Errorf(format string, v ...interface{})

Errorf print error with format.

func (*GLog) Info

func (l *GLog) Info(format string)

Info print info with format.

func (*GLog) Infoc

func (l *GLog) Infoc(ctx context.Context, format string)

Infoc print info log with context

func (*GLog) Infocf

func (l *GLog) Infocf(ctx context.Context, format string, v ...interface{})

Infocf print info log with context

func (*GLog) Infof

func (l *GLog) Infof(format string, v ...interface{})

Infof print info with format.

func (*GLog) Panic

func (l *GLog) Panic(format string)

Panic panic with format.

func (*GLog) Panicc

func (l *GLog) Panicc(ctx context.Context, format string)

Panicc panic with context

func (*GLog) Paniccf

func (l *GLog) Paniccf(ctx context.Context, format string, v ...interface{})

Paniccf panic with context

func (*GLog) Panicf

func (l *GLog) Panicf(format string, v ...interface{})

Panicf panic with format.

func (*GLog) Warn

func (l *GLog) Warn(format string)

Warn print warning with format.

func (*GLog) Warnc

func (l *GLog) Warnc(ctx context.Context, format string)

Warnc print warning with context

func (*GLog) Warncf

func (l *GLog) Warncf(ctx context.Context, format string, v ...interface{})

Warncf print warning with context

func (*GLog) Warnf

func (l *GLog) Warnf(format string, v ...interface{})

Warnf print warning with format.

func (*GLog) WithField

func (l *GLog) WithField(field string, value interface{}) Logger

WithField return a new logger with field

func (*GLog) WithFields

func (l *GLog) WithFields(fields map[string]interface{}) Logger

WithFields return a new logger with fields

type Logger

type Logger interface {
	Info(format string)
	Debug(format string)
	Warn(format string)
	Error(format string)
	Panic(format string)

	Infof(format string, v ...interface{})
	Debugf(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Panicf(format string, v ...interface{})

	Infoc(ctx context.Context, format string)
	Debugc(ctx context.Context, format string)
	Warnc(ctx context.Context, format string)
	Errorc(ctx context.Context, format string)
	Panicc(ctx context.Context, format string)

	Infocf(ctx context.Context, format string, v ...interface{})
	Debugcf(ctx context.Context, format string, v ...interface{})
	Warncf(ctx context.Context, format string, v ...interface{})
	Errorcf(ctx context.Context, format string, v ...interface{})
	Paniccf(ctx context.Context, format string, v ...interface{})

	WithField(field string, value interface{}) Logger
	WithFields(fields map[string]interface{}) Logger
	Close() error
}

Logger is an interface of logging operations

Jump to

Keyboard shortcuts

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