Remove Info.Print in favour of Log.Info
This commit is contained in:
1 parent
013380c7e7
commit
a5ddb63fca
22 files changed
+60
-61
No files matched your search
@@ -36,7 +36,7 @@ func NewClient(apiPath string) (*Client, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
Info.Printf("[docker] Using Docker API on %s: %v", apiPath, env)
|
||||
Log.Infof("[docker] Using Docker API on %s: %v", apiPath, env)
|
||||
return client, nil
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -38,21 +38,19 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
Log *logrus.Logger
|
||||
Info *logrus.Logger
|
||||
Log *logrus.Logger
|
||||
)
|
||||
|
||||
func InitLogging(level logrus.Level) {
|
||||
if Info == nil {
|
||||
Info = &logrus.Logger{
|
||||
if Log == nil {
|
||||
Log = &logrus.Logger{
|
||||
Out: os.Stderr,
|
||||
Formatter: standardTextFormatter,
|
||||
Hooks: make(logrus.LevelHooks),
|
||||
Level: level,
|
||||
}
|
||||
Log = Info
|
||||
}
|
||||
Info.Level = level
|
||||
Log.Level = level
|
||||
}
|
||||
|
||||
func InitDefaultLogging(debug bool) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// Ensure we can add new calls while forwarding the clock
|
||||
func TestSchedCallsBasic(t *testing.T) {
|
||||
InitDefaultLogging(testing.Verbose())
|
||||
Info.Println("TestSchedCallsBasic starting")
|
||||
Log.Infoln("TestSchedCallsBasic starting")
|
||||
|
||||
const testSecs = 1000
|
||||
clk := clock.NewMock()
|
||||
@@ -37,7 +37,7 @@ func TestSchedCallsBasic(t *testing.T) {
|
||||
// Ensure we can create a 100 seconds gap in the middle of the time travel
|
||||
func TestSchedCallsGap(t *testing.T) {
|
||||
InitDefaultLogging(testing.Verbose())
|
||||
Info.Println("TestSchedCallsGap starting")
|
||||
Log.Infoln("TestSchedCallsGap starting")
|
||||
|
||||
const testSecs = 1000
|
||||
clk := clock.NewMock()
|
||||
@@ -65,7 +65,7 @@ func TestSchedCallsGap(t *testing.T) {
|
||||
|
||||
func TestSchedCallsStop(t *testing.T) {
|
||||
InitDefaultLogging(testing.Verbose())
|
||||
Info.Println("TestSchedCallsStop starting")
|
||||
Log.Infoln("TestSchedCallsStop starting")
|
||||
|
||||
const testSecs = 1000
|
||||
clk := clock.NewMock()
|
||||
|
||||
+3
-3
@@ -20,17 +20,17 @@ func SignalHandlerLoop(ss ...SignalReceiver) {
|
||||
for {
|
||||
switch <-sigs {
|
||||
case syscall.SIGINT:
|
||||
Info.Printf("=== received SIGINT ===\n*** exiting\n")
|
||||
Log.Infof("=== received SIGINT ===\n*** exiting\n")
|
||||
for _, subsystem := range ss {
|
||||
subsystem.Stop()
|
||||
}
|
||||
return
|
||||
case syscall.SIGQUIT:
|
||||
stacklen := runtime.Stack(buf, true)
|
||||
Info.Printf("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf[:stacklen])
|
||||
Log.Infof("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf[:stacklen])
|
||||
case syscall.SIGUSR1:
|
||||
for _, subsystem := range ss {
|
||||
Info.Printf("=== received SIGUSR1 ===\n*** status...\n%s\n*** end\n", subsystem.Status())
|
||||
Log.Infof("=== received SIGUSR1 ===\n*** status...\n%s\n*** end\n", subsystem.Status())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user