zzlog

package module
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

README

zzlog

介绍

一个很简单的日志框架,按天分割日志, 支持error,info,debug 3种简单模式 日志同时输出文件和os.Stdout

软件架构

软件架构说明

安装教程
go get gitee.com/douyaye/zzlog
使用说明

直接使用即可,默认日志级别为debug

参考 example/main.go


zzlog.SetIsStdout(true)

// SetLogLevel 设置日志级别
// 	Debug:0
// 	Info:1
// 	Error:2
// 	OFF:3
//  默认值为 Debug:0
zzlog.SetLogLevel(2)



Documentation

Index

Constants

View Source
const (
	LevelDebug = iota
	LevelInfo
	LevelError
	LevelOff
)

Variables

View Source
var (
	Error  = errorLog.Println
	ErrorF = errorLog.Printf
	Info   = infoLog.Println
	InfoF  = infoLog.Printf
	Debug  = debugLog.Println
	DebugF = debugLog.Printf
)

Functions

func SetFlags added in v1.1.7

func SetFlags(flag int)

SetFlags default flag is (log.LstdFlags|log.Lshortfile|log.Lmsgprefix)

func SetIsStdout added in v1.1.4

func SetIsStdout(b bool)

SetIsStdout 设置是否打印到控制台 默认不打印

func SetLogDir added in v1.1.1

func SetLogDir(dir string)

SetLogDir 设置日志输出目录, 默认 ./zzlog

func SetLogLevel added in v1.1.1

func SetLogLevel(lv int)

SetLogLevel 设置日志级别

	Debug:0
	Info:1
	Error:2
	OFF:3
 默认值为 Debug:0

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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