Add functions for structured progress logging
This commit is contained in:
parent
58e452ea4e
commit
e852713ed7
5 changed files with 54 additions and 7 deletions
14
internal/output/output.go
Normal file
14
internal/output/output.go
Normal 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)
|
||||
}
|
||||
Loading…
Reference in a new issue