xlog

package
v0.0.0-...-8c0e806 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: LGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const TIME_FORMAT = "2006-01-02 15:04:05.000"

Variables

This section is empty.

Functions

func Alert

func Alert(args ...interface{})

func Alertf

func Alertf(format string, args ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

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

func Info

func Info(args ...interface{})

func Infof

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

func SetLogger

func SetLogger(level LogLevel, hostID string, logOpts ...*LogOption)

func Trace

func Trace(args ...interface{})

func Tracef

func Tracef(format string, args ...interface{})

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

Types

type LogLevel

type LogLevel int
const (
	TRACE LogLevel = iota
	DEBUG
	INFO
	WARN
	ERROR
	ALERT
)

func GetLogLevel

func GetLogLevel(loglevel string) LogLevel

func (LogLevel) String

func (ll LogLevel) String() string

type LogOption

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

func WithSlack

func WithSlack(opt *SlackOption) *LogOption

type Priority

type Priority string
const (
	LOW    Priority = "LOW"
	MEDIUM Priority = "MEDIUM"
	HIGH   Priority = "HIGH"
)

type SlackOption

type SlackOption struct {
	Level        LogLevel
	Webhook      string
	User         string
	Icon         string
	TraceChannel string
	DebugChannel string
	InfoChannel  string
	WarnChannel  string
	ErrorChannel string
	AlertChannel string
}

Jump to

Keyboard shortcuts

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