log

package
v0.1.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Author xc, Created on 2020-04-09 10:00 {COPYRIGHTS}

Author xc, Created on 2020-04-09 19:00 {COPYRIGHTS}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message interface{}, category string, ctx ...context.Context)

Output debug info with on category.

func EndTiming

func EndTiming(ctx context.Context, category string)

End timing on a category

func Error

func Error(message interface{}, label string, ctx ...context.Context)

Write error

func Fatal

func Fatal(message interface{})

func GetContextFields

func GetContextFields(ctx context.Context) logrus.Fields

func Info

func Info(message interface{})

system info

func InitContext

func InitContext(ctx context.Context, info *ContextInfo) context.Context

init a context log

func LogTiming

func LogTiming(ctx context.Context)

Log all timing, usually done in the end of request

func StartTiming

func StartTiming(ctx context.Context, category string)

start timing

func Warning

func Warning(message interface{}, label string, ctx ...context.Context)

Types

type ContextInfo

type ContextInfo struct {
	IP        string
	RequestID string
	URI       string
	UserID    int
	Timers    map[string]TimePoint
	Debug     bool
}

func GetContextInfo

func GetContextInfo(ctx context.Context) *ContextInfo

type RemoteHook

type RemoteHook struct {
}

func (*RemoteHook) Fire

func (hook *RemoteHook) Fire(entry *log.Entry) error

func (*RemoteHook) Levels

func (hook *RemoteHook) Levels() []log.Level

Levels define on which log levels this hook would trigger

type TimePoint

type TimePoint struct {
	Start int64
	End   int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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