forked from mongodb/grip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
journaling.go
28 lines (23 loc) · 919 Bytes
/
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
package grip
import "github.com/mongodb/grip/logging"
// 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)
}