logger

package module
v0.0.0-...-8e68072 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 7 Imported by: 0

README

logger

golang tracing logger

Documentation

Index

Constants

View Source
const (
	Splunk = 1 << iota
	Stdout
)

Variables

This section is empty.

Functions

func StdOut

func StdOut()

Types

type BTHandle

type BTHandle func(c *Context)

type Context

type Context struct {
	*gin.Context
}

type LogMessage

type LogMessage struct {
	Method   string `json:"_method"`
	Message  string `json:"msg"`
	From     string `json:"_from"`
	Ms       int    `json:"_ms"`
	UserId   int    `json:"_userId"`
	Name     string `json:"name"`
	Pid      int    `json:"pid"`
	TraceId  string `json:"traceId"`
	ReqUrl   string `json:"req_url"`
	Severity string `json:"severity"`
	Type     string `json:"type"`
	Host     string `json:"host"`
}

type Logger

type Logger struct {
	logger.LogLevel
	OutType       int
	SlowThreshold time.Duration
	ServiceName   string
}

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, s string, i ...interface{})

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, s string, i ...interface{})

func (*Logger) Log

func (l *Logger) Log(c context.Context, msg string)

func (*Logger) LogMode

func (l *Logger) LogMode(level logger.LogLevel) logger.Interface

func (*Logger) Print

func (l *Logger) Print(v ...interface{})

func (*Logger) Trace

func (l *Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, s string, i ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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