# README
log
参考 devspace v5.x版本
usage
package main
import (
"time"
"github.com/ergoapi/log"
"github.com/sirupsen/logrus"
)
func main() {
flog := log.GetInstance()
flog.SetLevel(logrus.DebugLevel)
log.StartFileLogging("/tmp", "test.log")
flog.StartWait("debug level")
flog.Debug("debug66666")
time.Sleep(time.Second * 2)
flog.Info("dididiidd")
flog.StopWait()
// flog.SetLevel(logrus.InfoLevel)
flog.StartWait("info level")
flog.Debug("debug777777")
time.Sleep(time.Second * 1)
flog.Info("hahahahahahah")
flog.StopWait()
flog.Done("done")
flog.Error("error")
flog.Fatal("fatal")
}
# Functions
GetFileLogger returns a logger instance for the specified filename.
GetInstance returns the Logger instance.
No description provided by the author
No description provided by the author
NewStreamLogger creates a new stream logger.
No description provided by the author
OverrideRuntimeErrorHandler overrides the standard runtime error handler that logs to stdout with a file logger that logs all runtime.HandleErrors to errors.log.
PrintTable prints a table with header columns and string values.
SetFakePrintTable is a testing tool that allows overwriting the function PrintTable.
SetInstance sets the default logger instance.
StartFileLogging logs the output of the global logger to the file default.log.
# Structs
DiscardLogger just discards every log statement.
StreamLogger logs all messages to a stream.
SurveyError is used to identify errors where questions were asked in the discard logger.
# Interfaces
Logger defines the common logging interface.