mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fix nil logger in inits
Move the logger initialization out of init in util.go and into the variable initializer. This ensures that it will be run before any of the other init functions.
This commit is contained in:
parent
a121cbb721
commit
0b37c808dd
6
util.go
6
util.go
@ -138,12 +138,8 @@ func check(err error) {
|
|||||||
// Log
|
// Log
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
||||||
var logger *log.Logger
|
var logger *log.Logger = log.New("etcd", false,
|
||||||
|
|
||||||
func init() {
|
|
||||||
logger = log.New("etcd", false,
|
|
||||||
log.CombinedSink(os.Stdout, "[%s] %s %-9s | %s\n", []string{"prefix", "time", "priority", "message"}))
|
log.CombinedSink(os.Stdout, "[%s] %s %-9s | %s\n", []string{"prefix", "time", "priority", "message"}))
|
||||||
}
|
|
||||||
|
|
||||||
func infof(format string, v ...interface{}) {
|
func infof(format string, v ...interface{}) {
|
||||||
logger.Infof(format, v...)
|
logger.Infof(format, v...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user