logx

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogAccess is log server request log
	LogAccess = logrus.New()
	// LogError is log server error log
	LogError = logrus.New()
)

Functions

func InitLog

func InitLog(accessLevel, accessLog, errorLevel, errorLog string) error

InitLog use for initial log module

func LogPush

func LogPush(input *InputLog)

LogPush record user push request and server response.

func SetLogLevel

func SetLogLevel(log *logrus.Logger, levelString string) error

SetLogLevel is define log level what you want log level: panic, fatal, error, warn, info and debug

func SetLogOut

func SetLogOut(log *logrus.Logger, outString string) error

SetLogOut provide log stdout and stderr output

Types

type InputLog

type InputLog struct {
	ID        string
	Status    string
	Token     string
	Message   string
	Platform  int
	Error     error
	HideToken bool
	Format    string
}

InputLog log request

type LogPushEntry

type LogPushEntry struct {
	ID       string `json:"notif_id,omitempty"`
	Type     string `json:"type"`
	Platform string `json:"platform"`
	Token    string `json:"token"`
	Message  string `json:"message"`
	Error    string `json:"error"`
}

LogPushEntry is push response log

func GetLogPushEntry

func GetLogPushEntry(input *InputLog) LogPushEntry

GetLogPushEntry get push data into log structure

Jump to

Keyboard shortcuts

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