logging: Enable logging across storage fs layer. (#1367)

Adds log.Debugf at all the layer - fixes #1074
This commit is contained in:
Harshavardhana
2016-04-24 00:36:00 -07:00
committed by Anand Babu (AB) Periasamy
parent d63d17012d
commit e9fba04b36
8 changed files with 287 additions and 39 deletions
+4 -4
View File
@@ -43,12 +43,12 @@ type logger struct {
}
// errorIf synonymous with fatalIf but doesn't exit on error != nil
func errorIf(err *probe.Error, msg string, fields map[string]interface{}) {
func errorIf(err *probe.Error, msg string, fields logrus.Fields) {
if err == nil {
return
}
if fields == nil {
fields = make(map[string]interface{})
fields = make(logrus.Fields)
}
fields["Error"] = struct {
Cause string `json:"cause,omitempty"`
@@ -65,12 +65,12 @@ func errorIf(err *probe.Error, msg string, fields map[string]interface{}) {
}
// fatalIf wrapper function which takes error and prints jsonic error messages.
func fatalIf(err *probe.Error, msg string, fields map[string]interface{}) {
func fatalIf(err *probe.Error, msg string, fields logrus.Fields) {
if err == nil {
return
}
if fields == nil {
fields = make(map[string]interface{})
fields = make(logrus.Fields)
}
fields["error"] = err.ToGoError()