123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- package logrus
- import (
- "context"
- "io"
- "time"
- )
- var (
-
- std = New()
- )
- func StandardLogger() *Logger {
- return std
- }
- func SetOutput(out io.Writer) {
- std.SetOutput(out)
- }
- func SetFormatter(formatter Formatter) {
- std.SetFormatter(formatter)
- }
- func SetReportCaller(include bool) {
- std.SetReportCaller(include)
- }
- func SetLevel(level Level) {
- std.SetLevel(level)
- }
- func GetLevel() Level {
- return std.GetLevel()
- }
- func IsLevelEnabled(level Level) bool {
- return std.IsLevelEnabled(level)
- }
- func AddHook(hook Hook) {
- std.AddHook(hook)
- }
- func WithError(err error) *Entry {
- return std.WithField(ErrorKey, err)
- }
- func WithContext(ctx context.Context) *Entry {
- return std.WithContext(ctx)
- }
- func WithField(key string, value interface{}) *Entry {
- return std.WithField(key, value)
- }
- func WithFields(fields Fields) *Entry {
- return std.WithFields(fields)
- }
- func WithTime(t time.Time) *Entry {
- return std.WithTime(t)
- }
- func Trace(args ...interface{}) {
- std.Trace(args...)
- }
- func Debug(args ...interface{}) {
- std.Debug(args...)
- }
- func Print(args ...interface{}) {
- std.Print(args...)
- }
- func Info(args ...interface{}) {
- std.Info(args...)
- }
- func Warn(args ...interface{}) {
- std.Warn(args...)
- }
- func Warning(args ...interface{}) {
- std.Warning(args...)
- }
- func Error(args ...interface{}) {
- std.Error(args...)
- }
- func Panic(args ...interface{}) {
- std.Panic(args...)
- }
- func Fatal(args ...interface{}) {
- std.Fatal(args...)
- }
- func TraceFn(fn LogFunction) {
- std.TraceFn(fn)
- }
- func DebugFn(fn LogFunction) {
- std.DebugFn(fn)
- }
- func PrintFn(fn LogFunction) {
- std.PrintFn(fn)
- }
- func InfoFn(fn LogFunction) {
- std.InfoFn(fn)
- }
- func WarnFn(fn LogFunction) {
- std.WarnFn(fn)
- }
- func WarningFn(fn LogFunction) {
- std.WarningFn(fn)
- }
- func ErrorFn(fn LogFunction) {
- std.ErrorFn(fn)
- }
- func PanicFn(fn LogFunction) {
- std.PanicFn(fn)
- }
- func FatalFn(fn LogFunction) {
- std.FatalFn(fn)
- }
- func Tracef(format string, args ...interface{}) {
- std.Tracef(format, args...)
- }
- func Debugf(format string, args ...interface{}) {
- std.Debugf(format, args...)
- }
- func Printf(format string, args ...interface{}) {
- std.Printf(format, args...)
- }
- func Infof(format string, args ...interface{}) {
- std.Infof(format, args...)
- }
- func Warnf(format string, args ...interface{}) {
- std.Warnf(format, args...)
- }
- func Warningf(format string, args ...interface{}) {
- std.Warningf(format, args...)
- }
- func Errorf(format string, args ...interface{}) {
- std.Errorf(format, args...)
- }
- func Panicf(format string, args ...interface{}) {
- std.Panicf(format, args...)
- }
- func Fatalf(format string, args ...interface{}) {
- std.Fatalf(format, args...)
- }
- func Traceln(args ...interface{}) {
- std.Traceln(args...)
- }
- func Debugln(args ...interface{}) {
- std.Debugln(args...)
- }
- func Println(args ...interface{}) {
- std.Println(args...)
- }
- func Infoln(args ...interface{}) {
- std.Infoln(args...)
- }
- func Warnln(args ...interface{}) {
- std.Warnln(args...)
- }
- func Warningln(args ...interface{}) {
- std.Warningln(args...)
- }
- func Errorln(args ...interface{}) {
- std.Errorln(args...)
- }
- func Panicln(args ...interface{}) {
- std.Panicln(args...)
- }
- func Fatalln(args ...interface{}) {
- std.Fatalln(args...)
- }
|