TTDL-5 Added better error handling

This commit is contained in:
Pijus Kamandulis
2020-02-25 20:12:01 +02:00
parent 1b3f985f42
commit 7a691ad32d
10 changed files with 113 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ package utils
import (
config "../models/config"
"fmt"
"os"
)
// Log - Write to std out
@@ -23,3 +24,8 @@ func Logf(format string, a ...interface{}) {
func LogFatal(format string, a ...interface{}) {
panic(fmt.Sprintf(format, a...))
}
// LogErr - Write error
func LogErr(format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
}