forked from stellar/go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
entry.go
72 lines (57 loc) · 1.73 KB
/
entry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package log
import (
"github.com/sirupsen/logrus"
"github.com/stellar/go/services/horizon/internal/errors"
)
type Entry struct {
logrus.Entry
}
func (e *Entry) WithField(key string, value interface{}) *Entry {
return &Entry{*e.Entry.WithField(key, value)}
}
func (e *Entry) WithFields(fields F) *Entry {
return &Entry{*e.Entry.WithFields(logrus.Fields(fields))}
}
func (e *Entry) WithStack(err error) *Entry {
return e.WithField("stack", errors.Stack(err))
}
// Debugf logs a message at the debug severity.
func (e *Entry) Debugf(format string, args ...interface{}) {
e.Entry.Debugf(format, args...)
}
// Debug logs a message at the debug severity.
func (e *Entry) Debug(args ...interface{}) {
e.Entry.Debug(args...)
}
// Infof logs a message at the Info severity.
func (e *Entry) Infof(format string, args ...interface{}) {
e.Entry.Infof(format, args...)
}
// Info logs a message at the Info severity.
func (e *Entry) Info(args ...interface{}) {
e.Entry.Info(args...)
}
// Warnf logs a message at the Warn severity.
func (e *Entry) Warnf(format string, args ...interface{}) {
e.Entry.Warnf(format, args...)
}
// Warn logs a message at the Warn severity.
func (e *Entry) Warn(args ...interface{}) {
e.Entry.Warn(args...)
}
// Errorf logs a message at the Error severity.
func (e *Entry) Errorf(format string, args ...interface{}) {
e.Entry.Errorf(format, args...)
}
// Error logs a message at the Error severity.
func (e *Entry) Error(args ...interface{}) {
e.Entry.Error(args...)
}
// Panicf logs a message at the Panic severity.
func (e *Entry) Panicf(format string, args ...interface{}) {
e.Entry.Panicf(format, args...)
}
// Panic logs a message at the Panic severity.
func (e *Entry) Panic(args ...interface{}) {
e.Entry.Panic(args...)
}