zdpgo_log

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 2 Imported by: 15

README

zdpgo_log

Golang日志框架

一、快速入门

1.1 创建日志并记录
package main

import "github.com/zhangdapeng520/zdpgo_log"

func main() {
	log := zdpgo_log.New("zdpgo_log.log")
	log.Debug = true // 开启debug模式

	log.Info("info...")
	log.Warning("warning...")
	log.Error("error...")

	log.Debug = false // 关闭debug模式
	
	log.Info("info 111...")
	log.Warning("warning 111...")
	log.Error("error 111...")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Log       *log.Logger // 日志对象
	LogConsol *log.Logger // 日志对象,输出到控制台
	LogError  *log.Logger // 日志对象,输出到控制台,记录错误类型的日志
	Debug     bool        // 是否为debug模式,如果是debug模式,日志会输出到控制台
	Path      string      // 日志保存路径
}

func New

func New(path string) *Log

func (*Log) Error

func (log *Log) Error(args ...interface{})

记录error类型的日志

func (*Log) Info

func (log *Log) Info(args ...interface{})

记录info类型的日志

func (*Log) Warning

func (log *Log) Warning(args ...interface{})

记录warning类型的日志

Directories

Path Synopsis
examples
z01_hello command

Jump to

Keyboard shortcuts

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