log

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 3 Imported by: 8

Documentation

Overview

Package log is from https://github.com/micro/go-micro/blob/master/util/log/log.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

Debug provides debug level logging

func Debugf

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

Debugf provides debug level logging

func Error

func Error(v ...interface{})

Error provides warn level logging

func Errorf

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

Errorf provides warn 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 Info

func Info(v ...interface{})

Info provides info level logging

func Infof

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

Infof provides info level logging

func Log

func Log(v ...interface{})

Log makes use of Logger

func Logf

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

Logf makes use of Logger

func Name

func Name(name string)

Name sets service name

func SetLevel

func SetLevel(l Level)

SetLevel sets the log level

func SetLogger

func SetLogger(l Logger)

SetLogger sets the local logger

func SetPrefix

func SetPrefix(p string)

SetPrefix sets a prefix for the logger

func WithLevel

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

WithLevel logs with the level specified

func WithLevelf

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

WithLevelf logs with the level specified

Types

type Level

type Level int

Level is a log level

const (
	// LevelFatal fatal level
	LevelFatal Level = iota + 1
	// LevelInfo info level
	LevelInfo
	// LevelError error level
	LevelError
	// LevelDebug debug level
	LevelDebug
)

func GetLevel

func GetLevel() Level

GetLevel returns the current level

type Logger

type Logger interface {
	Log(v ...interface{})
	Logf(format string, v ...interface{})
}

Logger is a generic logging interface

func GetLogger

func GetLogger() Logger

GetLogger returns the local logger

Jump to

Keyboard shortcuts

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