log

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

go-mantis-log

  • go日志封装,封装了logrus和zap
  • 日志格式化为json
  • 日志滚动切割
  • 分布式日志追踪

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...interface{})

普通日志

func Debugf

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

其他日志 如:HTTP RPC日志

func Error

func Error(msg string, args ...interface{})

func Errorf

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

func Fatal

func Fatal(msg string, args ...interface{})

func Fatalf

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

func Info

func Info(msg string, args ...interface{})

func Infof

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

func Panic

func Panic(msg string, args ...interface{})

func Panicf

func Panicf(format string, args ...interface{})

func SetLogger

func SetLogger(ll ILog)

设置

func Warn

func Warn(msg string, args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

Types

type ILog

type ILog interface {
	// 普通日志,如果有args,需要格式化
	Debug(string, ...interface{})
	Info(string, ...interface{})
	Warn(string, ...interface{})
	Error(string, ...interface{})
	Panic(string, ...interface{})
	Fatal(string, ...interface{})
	// 需要格式化日志 ,最后一个是context
	Debugf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Errorf(string, ...interface{})
	Panicf(string, ...interface{})
	Fatalf(string, ...interface{})
}

定义Log接口

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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