log

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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