gollog

package
v0.0.0-...-1bfd785 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GinLogger     = logrus.New()
	GinTimeFormat = time.RFC3339
	GinEnableUTC  = false
)
View Source
var (
	/*
		O:"panic"
		1:"fatal"
		2:"error"
		3:"warn"
		4:"info"
		5:"debug"
	*/
	LogLevel = golenv.OverrideIfEnv("GOLLOG_LOG_LEVEL", "5")
)

Functions

func CloseLogFile

func CloseLogFile(log *os.File)

close LogFile

func Debug

func Debug(msg string)

func Debugf

func Debugf(msg string, param ...interface{})

func Err

func Err(msg string)

func Errf

func Errf(msg string, param ...interface{})

func GinLogrus

func GinLogrus() gin.HandlerFunc

func Info

func Info(msg string)

func Infof

func Infof(msg string, param ...interface{})

func LogIt

func LogIt(fyl *os.File, lyn string)

just write to given file handle

func LogOnce

func LogOnce(logfile string, msg string)

Open, Log, Close

func OpenLogFile

func OpenLogFile(logFile string) *os.File

Logfile sends back handle of opened logfile, remember to defer F.Close() at usage.

func Panic

func Panic(msg string)

func Panicf

func Panicf(msg string, param ...interface{})

func Warn

func Warn(msg string)

func Warnf

func Warnf(msg string, param ...interface{})

Types

type Log

type Log struct {
	Level  string
	Thread chan string
}

Log to declare different streams to manage log

logInfo := gollog.Log{Level: "info", Thread: make(chan string)} go logInfo.LogIt()

logInfo.Thread <- fmt.Sprintf("Message Received: %s", string(msg))

func (Log) Start

func (l Log) Start()

start Log Action

type Logrus

type Logrus struct {
	LogLevel int
}

Jump to

Keyboard shortcuts

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