log

package
v0.0.0-...-ffa5e5f Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

####项目简介 通用日志打印, 参考b站Go框架Log组件

####错误类别 1.DEBUG (调试信息打印)

2.INFO (日常信息打印)

3.WARNING (警告信息打印,安全日志打印)

4.ERROR (运行错误信息打印)

5.FATAL (任务失败信息打印)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() (err error)

func Debug

func Debug(format string, args ...map[string]interface{})

func Error

func Error(format string, args ...map[string]interface{})

func Fatal

func Fatal(format string, args ...map[string]interface{})

func Info

func Info(format string, args ...map[string]interface{})

func Init

func Init(conf *Config)

func Warning

func Warning(format string, args ...map[string]interface{})

Types

type Config

type Config struct {
	ServiceName string

	ServiceId string

	Host string

	Zone string

	Stdout bool

	Dir string

	Level Level //记录等级以上将被记录

	MaxLogFile int

	MaxLogSize int64
}

type FW

type FW interface {
	Log(l Level, t string, data []map[string]interface{})

	Close() error
}

type Files

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

func NewFile

func NewFile(dir string, MaxLogFile int, MaxLogSize int64) *Files

func (*Files) Close

func (f *Files) Close() error

func (*Files) Log

func (f *Files) Log(l Level, text string, data []map[string]interface{})

type Level

type Level int

func (Level) String

func (l Level) String() string

type Stdout

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

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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