flog

package
v4.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

日志.

Example
Debug("hello world.")
Info("hello world.")
Warn("hello world.")
Error("hello world.")
Fatal("hello world.")

SetLogLevel(INFO)
SetProjectName("TEST", F_WARN|F_FATAL)
Debug("hello world.")
Info("hello world.")
Warn("hello world.")
Error("hello world.")
Fatal("hello world.")
return
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message interface{})

func Error

func Error(message interface{})

func Fatal

func Fatal(message interface{})

func Info

func Info(message interface{})

message类型支持, string, error, ftype.Stringer, []byte.

func SetLogLevel

func SetLogLevel(level LogLevel)

设置日志等级. 低于这个等级的日志不会被输出.

func SetProjectName

func SetProjectName(name string, flag LogFlag)

允许日志记录到文件中. @name - 项目名. @flag - 标志, 表示哪个日志级别需要记录.

func Warn

func Warn(message interface{})

Types

type LogFlag

type LogFlag int64

日志标志. 表示哪些日志需要记录.

const (
	F_DEBUG LogFlag = 1 << iota
	F_INFO
	F_WARN
	F_ERROR
	F_FATAL
)

type LogLevel

type LogLevel int64

日志等级.

const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
	FATAL
	NONE
)
const (
	L_DEBUG LogLevel = iota
	L_INFO
	L_WARN
	L_ERROR
	L_FATAL
	L_NONE
)

Jump to

Keyboard shortcuts

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