Add functions for structured progress logging

This commit is contained in:
Arturo Filastò
2018-03-22 15:22:29 +01:00
parent 58e452ea4e
commit e852713ed7
5 changed files with 54 additions and 7 deletions
+14
View File
@@ -0,0 +1,14 @@
package output
import (
"github.com/apex/log"
)
// Progress logs a progress type event
func Progress(key string, perc float64, msg string) {
log.WithFields(log.Fields{
"type": "progress",
"key": key,
"percentage": perc,
}).Info(msg)
}