summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorspf13 <steve.francia@gmail.com>2014-03-31 13:23:34 -0400
committerspf13 <steve.francia@gmail.com>2014-03-31 13:23:34 -0400
commite50b9d8ac1c69aa16cf45b1e4ff95b22d535adb7 (patch)
tree8c16489a5cf2631649805d547256d4427d9486d8 /utils
parent2fa3761ec993657330d5b9ddbaaab1f58797fb61 (diff)
Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/utils.go b/utils/utils.go
index a79740c9a..bb0248084 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -1,22 +1,24 @@
package utils
import (
- "log"
"os"
+
+ jww "github.com/spf13/jwalterweatherman"
)
func CheckErr(err error, s ...string) {
if err != nil {
for _, message := range s {
- log.Fatalf(message)
+ jww.ERROR.Println(message)
}
- log.Fatalf("Fatal Error: %v", err)
}
}
func StopOnErr(err error, s ...string) {
if err != nil {
- CheckErr(err, s...)
+ for _, message := range s {
+ jww.CRITICAL.Println(message)
+ }
os.Exit(-1)
}
}