feat: improve logging and added verbose output
This commit is contained in:
parent
a95389f25d
commit
e0f87d7ef9
6 changed files with 104 additions and 46 deletions
|
|
@ -41,7 +41,7 @@ func progressBar(repositories []Repository) {
|
|||
|
||||
func progressBarAdd(amount int) {
|
||||
if err := bar.Add(amount); err != nil {
|
||||
log.Printf("ERROR: Progress bar update error: %v\n", err)
|
||||
logPrint("ERROR: Progress bar update error: %v\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,3 +66,21 @@ func printPullError(pullErrorMsg []string) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func logPrint(message string, err error) {
|
||||
if verbose == true {
|
||||
if err != nil {
|
||||
log.Printf("gogitlabber | %v error: %v\n", message, err)
|
||||
}
|
||||
if err == nil {
|
||||
log.Printf("gogitlabber | %v\n", message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func logFatal(message string, err error) {
|
||||
if err != nil {
|
||||
log.Fatalf("gogitlabber | FATAL: %v error: %v\n", message, err)
|
||||
}
|
||||
log.Fatalf("gogitlabber | FATAL: %v\n", message)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue