log

package
v0.0.0-...-750a8a5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

@Description logrus hook @Author jiangyang @Created 2020/11/27 11:27 上午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfg Config)

初始化日志

Types

type Config

type Config struct {
	Format       string   `json:"format" yaml:"format"`
	Level        string   `json:"level" yaml:"level"`
	Hooks        []string `json:"hooks" yaml:"hooks"`
	Emails       []string `json:"emails" yaml:"emails"`
	Mobile       string   `json:"mobile" yaml:"mobile"`
	EmailLevel   string   `json:"email_level" yaml:"email_level" mapstructure:"email_level"`
	ReportCaller bool     `json:"report_caller" yaml:"report_caller" mapstructure:"report_caller"`
}

type EmailHook

type EmailHook struct {
	MailTo []string
	Level  string
}

EmailHook

func (*EmailHook) Fire

func (hook *EmailHook) Fire(entry *logrus.Entry) error

func (*EmailHook) Levels

func (hook *EmailHook) Levels() []logrus.Level

type EsHook

type EsHook struct{}

EsHook

func (*EsHook) Fire

func (hook *EsHook) Fire(entry *logrus.Entry) error

func (*EsHook) Levels

func (hook *EsHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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