-
Notifications
You must be signed in to change notification settings - Fork 22
/
journaling.go
36 lines (30 loc) · 1.08 KB
/
journaling.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
package grip
import (
"github.com/mongodb/grip/logging"
"github.com/mongodb/grip/send"
)
// The base type for all Journaling methods provided by the Grip
// package. The package logger uses systemd logging on Linux, when
// possible, falling back to standard output-native when systemd
// logging is not available.
// NewJournaler creates a new Journaler instance. The Sender method is a
// non-operational bootstrap method that stores default and threshold
// types, as needed. You must use SetSender() or the
// UseSystemdLogger(), UseNativeLogger(), or UseFileLogger() methods
// to configure the backend.
func NewJournaler(name string) Journaler {
return logging.NewGrip(name)
}
// Name of the logger instance
func Name() string {
return std.Name()
}
// SetName declare a name string for the logger, including in the logging
// message. Typically this is included on the output of the command.
func SetName(name string) {
std.SetName(name)
}
// SetLevel sets the default and threshold level in the underlying sender.
func SetLevel(info send.LevelInfo) error {
return std.SetLevel(info)
}