log

package
v1.4.14 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 143

Documentation

Overview

Package log beego日志

Package log 日志结构定义

Package log 日志初始化

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BiBeego

func BiBeego() *beegolog.BeeLogger

BiBeego BiBeego

func BiReport

func BiReport(msg string)

BiReport BiReport

func Close

func Close()

Close Close

func Debug

func Debug(format string, a ...interface{})

Debug Debug

func Error

func Error(format string, a ...interface{})

Error Error

func Info

func Info(format string, a ...interface{})

Info Info

func Init added in v1.4.13

func Init(cc ...Option)

Init 初始化配置

func InitBI

func InitBI(debug bool, ProcessID string, Logdir string, settings map[string]interface{}, logFilePath func(logdir, prefix, processID, suffix string) string)

InitBI 初始化BI日志

func InitLog

func InitLog(debug bool, ProcessID string, Logdir string, settings map[string]interface{}, logFilePath func(logdir, prefix, processID, suffix string) string)

InitLog 初始化日志

func InstallOptionsWatchDog added in v1.4.13

func InstallOptionsWatchDog(dog func(cc *Options))

func LogBeego

func LogBeego() *beegolog.BeeLogger

LogBeego LogBeego

func NewBeegoLogger

func NewBeegoLogger(debug bool, ProcessID string, Logdir string, settings map[string]interface{}, logFilePath func(logdir, prefix, processID, suffix string) string) *logs.BeeLogger

NewBeegoLogger beego

func OptionsOptionDeclareWithDefault added in v1.4.13

func OptionsOptionDeclareWithDefault() interface{}

func TDebug

func TDebug(span TraceSpan, format string, a ...interface{})

TDebug TDebug

func TError

func TError(span TraceSpan, format string, a ...interface{})

TError TError

func TInfo

func TInfo(span TraceSpan, format string, a ...interface{})

TInfo TInfo

func TWarning

func TWarning(span TraceSpan, format string, a ...interface{})

TWarning TWarning

func Warning

func Warning(format string, a ...interface{})

Warning Warning

Types

type Option added in v1.4.13

type Option func(cc *Options) Option

func WithBIFileName added in v1.4.13

func WithBIFileName(v func(logdir, prefix, processID, suffix string) string) Option

func WithBiDir added in v1.4.13

func WithBiDir(v string) Option

func WithBiSetting added in v1.4.13

func WithBiSetting(v map[string]interface{}) Option

func WithDebug added in v1.4.13

func WithDebug(v bool) Option

func WithLogDir added in v1.4.13

func WithLogDir(v string) Option

func WithLogFileName added in v1.4.13

func WithLogFileName(v func(logdir, prefix, processID, suffix string) string) Option

func WithLogSetting added in v1.4.13

func WithLogSetting(v map[string]interface{}) Option

func WithProcessID added in v1.4.13

func WithProcessID(v string) Option

type Options added in v1.4.13

type Options struct {
	Debug       bool
	ProcessID   string
	LogDir      string
	LogFileName func(logdir, prefix, processID, suffix string) string
	BiDir       string
	BIFileName  func(logdir, prefix, processID, suffix string) string
	BiSetting   map[string]interface{}
	LogSetting  map[string]interface{}
}

func NewOptions added in v1.4.13

func NewOptions(opts ...Option) *Options

func (*Options) ApplyOption added in v1.4.13

func (cc *Options) ApplyOption(opts ...Option)

func (*Options) GetSetOption added in v1.4.13

func (cc *Options) GetSetOption(opt Option) Option

func (*Options) SetOption added in v1.4.13

func (cc *Options) SetOption(opt Option)

type TraceSpan

type TraceSpan interface {

	// Trace is the root ID of the tree that contains all of the spans
	// related to this one.
	TraceId() string

	// Span is an ID that probabilistically uniquely identifies this
	// span.
	SpanId() string

	ExtractSpan() TraceSpan
}

TraceSpan A SpanID refers to a single span.

func CreateRootTrace

func CreateRootTrace() TraceSpan

CreateRootTrace CreateRootTrace

func CreateTrace

func CreateTrace(trace, span string) TraceSpan

CreateTrace CreateTrace

type TraceSpanImp

type TraceSpanImp struct {
	Trace string `json:"Trace"`
	Span  string `json:"Span"`
}

TraceSpanImp TraceSpanImp

func (*TraceSpanImp) ExtractSpan

func (t *TraceSpanImp) ExtractSpan() TraceSpan

ExtractSpan ExtractSpan

func (*TraceSpanImp) SpanID added in v1.3.6

func (t *TraceSpanImp) SpanID() string

SpanID SpanID

func (*TraceSpanImp) SpanId

func (t *TraceSpanImp) SpanId() string

SpanId SpanId Deprecated: 因为命名规范问题函数将废弃,请用SpanID代替

func (*TraceSpanImp) TraceID added in v1.3.6

func (t *TraceSpanImp) TraceID() string

TraceID TraceID

func (*TraceSpanImp) TraceId

func (t *TraceSpanImp) TraceId() string

TraceId TraceId Deprecated: 因为命名规范问题函数将废弃,请用TraceID代替

Directories

Path Synopsis
Package logs provide a general log interface Usage: import "github.com/astaxie/beego/logs" log := NewLogger(10000) log.SetLogger("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") more docs http://beego.me/docs/module/logs.md Copyright 2014 mqant Author.
Package logs provide a general log interface Usage: import "github.com/astaxie/beego/logs" log := NewLogger(10000) log.SetLogger("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") more docs http://beego.me/docs/module/logs.md Copyright 2014 mqant Author.
es

Jump to

Keyboard shortcuts

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