logMap

package
v0.0.0-...-cee649a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 9 Imported by: 1

README

各种log实例

为了便于将不同的日志记录在不同位置,例如:程序日志、登录日志、数据库日志等。

开发一个log注册器,其他程序可根据用途名称获取不同的log实例

Documentation

Index

Constants

View Source
const (
	NORMAL  = "normal"
	LOGIN   = "login"
	GIN     = "gin"
	DEFAULT = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DkLog

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

func (DkLog) Error

func (dl DkLog) Error(args ...interface{})

func (DkLog) Fatal

func (dl DkLog) Fatal(args ...interface{})

func (DkLog) Info

func (dl DkLog) Info(args ...interface{})

func (DkLog) WithFields

func (dl DkLog) WithFields(fields logrus.Fields) DkLog

type LogMap

type LogMap struct {
	ThePathMap   map[string]string           `yaml:"logPath,omitempty"`
	TheLoggerMap map[string](*logrus.Logger) `yaml:"-"`
}

func LoadLogConfig

func LoadLogConfig(filepath string) (theLogMap LogMap, err error)

func NewLogMap

func NewLogMap(configFile string) (theLogMap LogMap)

func (LogMap) Log

func (theLogMap LogMap) Log(types ...string) (dl DkLog)

Jump to

Keyboard shortcuts

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