catLog

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

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

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 11 Imported by: 4

README

CatLog

介绍

golang日志模块,基于golang自带的log模块新增日志等级,日志回滚,日志格式输出

软件架构

CatLog基于golang自带log某块二次开发,主要提供回滚方式和日志等级

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
码云特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

View Source
const DefaultFileSize = 1 << 23 // 8m  b/1024 kb/1024 m
View Source
const LogDir = "log"
View Source
const LogExtensionName = ".log"

Variables

This section is empty.

Functions

func Debug

func Debug(f interface{}, v ...interface{})

func Error

func Error(f interface{}, v ...interface{})

func GetLOGDir

func GetLOGDir() string

func GetNewLogFile

func GetNewLogFile(dirPath string) *os.File

func Info

func Info(f interface{}, v ...interface{})

func InitLog

func InitLog(dir string)

func Panic

func Panic(f interface{}, v ...interface{})

func Warning

func Warning(f interface{}, v ...interface{})

Types

type LogLevel

type LogLevel int
const (
	LevelDebug   LogLevel = iota + 1 // 绿色
	LevelInfo                        // 蓝色
	LevelWarning                     // 黄色
	LevelError                       // 红色
)

type LogOutType

type LogOutType string

outtype

const (
	AdapterConsole LogOutType = "console" // 输出到控制台
	AdapterFile    LogOutType = "file"    // 输出到文件
)

type LogWriter

type LogWriter interface {
	Write(p []byte) (n int, err error)
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}
var LOG *Logger

func (*Logger) GetLogDir

func (object *Logger) GetLogDir(m *logMsg) string

type MultiWriter

type MultiWriter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(dirPath string) *MultiWriter

type RotatingType

type RotatingType int
const (
	TimeRotate RotatingType = iota + 1 // 每隔多长时间回滚
	SizeRotate                         // 固定大小回滚
)

Jump to

Keyboard shortcuts

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