Refactor logger (#3924)

This patch fixes below

* Previously fatalIf() never writes log other than first logging target.
* quiet flag is not honored to show progress messages other than startup messages.
* Removes console package usage for progress messages.
This commit is contained in:
Bala FA
2017-03-24 05:06:00 +05:30
committed by Harshavardhana
parent 11e15f9b4c
commit d3cb79a57c
18 changed files with 450 additions and 426 deletions
+3 -5
View File
@@ -44,7 +44,7 @@ type serverConfigV16 struct {
Browser string `json:"browser"`
// Additional error logging configuration.
Logger *logger `json:"logger"`
Logger *loggers `json:"logger"`
// Notification queue configuration.
Notify *notifier `json:"notify"`
@@ -54,15 +54,13 @@ func newServerConfigV16() *serverConfigV16 {
srvCfg := &serverConfigV16{
Version: v16,
Region: globalMinioDefaultRegion,
Logger: &logger{},
Logger: &loggers{},
Notify: &notifier{},
}
srvCfg.SetCredential(mustGetNewCredential())
srvCfg.SetBrowser("on")
// Enable console logger by default on a fresh run.
srvCfg.Logger.Console = consoleLogger{
Enable: true,
}
srvCfg.Logger.Console = NewConsoleLogger()
// Make sure to initialize notification configs.
srvCfg.Notify.AMQP = make(map[string]amqpNotify)