logx

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 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 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 DefaultQueueLogger

type DefaultQueueLogger struct {
	// contains filtered or unexported fields
}

DefaultQueueLogger for queue custom logger

func QueueLogger

func QueueLogger() DefaultQueueLogger

QueueLogger for simple logger.

func (DefaultQueueLogger) Error

func (l DefaultQueueLogger) Error(args ...interface{})

func (DefaultQueueLogger) Errorf

func (l DefaultQueueLogger) Errorf(format string, args ...interface{})

func (DefaultQueueLogger) Fatal

func (l DefaultQueueLogger) Fatal(args ...interface{})

func (DefaultQueueLogger) Fatalf

func (l DefaultQueueLogger) Fatalf(format string, args ...interface{})

func (DefaultQueueLogger) Info

func (l DefaultQueueLogger) Info(args ...interface{})

func (DefaultQueueLogger) Infof

func (l DefaultQueueLogger) Infof(format string, args ...interface{})

type InputLog

type InputLog struct {
	ID          string
	Status      string
	Token       string
	Message     string
	Platform    int
	Error       error
	HideToken   bool
	HideMessage 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

func LogPush

func LogPush(input *InputLog) LogPushEntry

LogPush record user push request and server response.

Jump to

Keyboard shortcuts

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