logs

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logs 日志管理包。

通过本包,可自动生成日志文件,并根据当前日期创建对应存放目录。

Index

Constants

View Source
const (
	LevelTrace logLevel                                 = 1 << iota // 追踪日志
	LevelInfo                                                       // 普通信息
	LevelWarn                                                       // 警告信息
	LevelError                                                      // 错误信息
	Flags      = log.Ldate | log.Ltime | log.Lshortfile             // 日志参数
)

Variables

View Source
var Logger *logger

Functions

func Close

func Close()

Close 关闭日志

func Error

func Error(format string, a ...interface{})

Error 错误信息

func Fatal

func Fatal(format string, a ...interface{})

Fatal 按照格式写入致命信息

func FatalError

func FatalError(err error)

FatalError 出错则写入致命错误

func Info

func Info(format string, a ...interface{})

Info 普通信息

func Log

func Log(file string)

Log 创建日志对象

func Trace

func Trace(format string, a ...interface{})

Trace 追踪日志

func Warning

func Warning(format string, a ...interface{})

Warning 警告信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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