logger

package
v0.0.0-...-674a536 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG = "DEBUG"
	INFO  = "INFO"
	ERROR = "ERROR"
)

Only support three log levels

Variables

View Source
var (
	Conn *net.TCPConn
)
View Source
var (
	LogLevel string
)

Functions

func Error

func Error(msg interface{})

func ErrorFields

func ErrorFields(msg string, fields Fields)

func GetConnLogger

func GetConnLogger() *log.Logger

func GetConsoleLogger

func GetConsoleLogger() *log.Logger

func Info

func Info(msg interface{})

Print log in simple way

func InfoFields

func InfoFields(msg string, fields Fields)

InfoFields prints log with fields

func Locate

func Locate(skip int) (filename string, line int)

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel sets log level for logrus and local console. Accept info and error level. By default, it is info level.

Types

type Fields

type Fields map[string]interface{}

type LoggingRemoteOpts

type LoggingRemoteOpts struct {
	RemoteProtocol string             `json:"protocol"`
	RemoteServer   string             `json:"remote_server"`
	Flag           int                `json:"flag"`
	Priority       logsyslog.Priority `json:"priority"`
	Tag            string             `json:"tag"`
}

Jump to

Keyboard shortcuts

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