log

package module
v0.0.0-...-fc3a37d Latest Latest
Warning

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

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

README

之前搞定了zaplog到redis然后elk显示的日志类,但是输出没有tracing,网上看到github.com/xiaomeng79/go-log,于是也懒得自己搞了,直接两边整合,在它基础上加入写入redis输出到elk的东西,这样功能就齐全了。

对,就是拿来主义。。。。。O(∩_∩)O哈哈~

go get -u github.com/long12310225/go-zaplog-tracing-redis-elk

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 {
	//new
	//普通日志,如果有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{})
}

使用string是为了减少使用Spintf

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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