log

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 3 Imported by: 954

README

Log

This is the global logger for all micro based libraries which makes use of github.com/go-log/log.

It defaults the logger to the stdlib log implementation.

Set Logger

Set the logger for micro libraries

// import go-micro/util/log
import "github.com/micro/go-micro/util/log"

// SetLogger expects github.com/go-log/log.Logger interface
log.SetLogger(mylogger)

Documentation

Overview

Package log is a global internal logger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v1.8.0

func Debug(v ...interface{})

Debug provides debug level logging

func Debugf added in v1.8.0

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

Debugf provides debug level logging

func Fatal

func Fatal(v ...interface{})

Fatal logs with Log and then exits with os.Exit(1)

func Fatalf

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

Fatalf logs with Logf and then exits with os.Exit(1)

func GetLogger added in v1.8.0

func GetLogger() log.Logger

GetLogger returns the local logger

func Info added in v1.8.0

func Info(v ...interface{})

Info provides info level logging

func Infof added in v1.8.0

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

Infof provides info level logging

func Log

func Log(v ...interface{})

Log makes use of github.com/go-log/log.Log

func Logf

func Logf(format string, v ...interface{})

Logf makes use of github.com/go-log/log.Logf

func SetLevel added in v1.8.0

func SetLevel(l Level)

SetLevel sets the log level

func SetLogger

func SetLogger(l log.Logger)

SetLogger sets the local logger

func Trace added in v1.8.0

func Trace(v ...interface{})

Trace provides trace level logging

func Tracef added in v1.8.0

func Tracef(format string, v ...interface{})

Tracef provides trace level logging

func WithLevel added in v1.8.0

func WithLevel(l Level, v ...interface{})

WithLevel logs with the level specified

func WithLevelf added in v1.8.0

func WithLevelf(l Level, format string, v ...interface{})

WithLevel logs with the level specified

Types

type Level added in v1.8.0

type Level int

level is a log level

func GetLevel added in v1.8.0

func GetLevel() Level

GetLevel returns the current level

Jump to

Keyboard shortcuts

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