log

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

日志功能模块。

Index

Constants

View Source
const (
	LevelOff      = 0x00
	LevelCritical = 0x01
	LevelError    = 0x02
	LevelWarning  = 0x03
	LevelInfo     = 0x04
	LevelVerbos   = 0x05
	LevelDebug    = 0x06
	LevelMask     = 0x07
)
View Source
const Audit = 0x08
View Source
const ConfigBoolNBSAudit = 3
View Source
const ConfigIntegerNBSMaxLogCount = 4
View Source
const ConfigIntegerNBSMaxLogSize = 3
View Source
const ConfigStringNBSLevel = 4
View Source
const ConfigStringNBSLogFileName = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(conf *cache_config.Configuration) *Logger

创建一个写日志对象,使用 configBase.ConfigBase对象初始化

func (*Logger) Append

func (l *Logger) Append(data string)

追加文本,不打印时间pid等信息

func (*Logger) Enabled

func (l *Logger) Enabled(level int) bool

func (*Logger) Print

func (l *Logger) Print(level int, a ...interface{})

功能参考fmt.Print

func (*Logger) Printf

func (l *Logger) Printf(level int, format string, a ...interface{})

格式化字符串输出,功能参考fmt.Printf

func (*Logger) Println

func (l *Logger) Println(level int, a ...interface{})

功能参考fmt.Println

func (*Logger) Release

func (l *Logger) Release()

停止日志对象,不再写入

Jump to

Keyboard shortcuts

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