Skip to content

Commit

Permalink
colorful
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonz committed Jul 21, 2017
1 parent 46747f6 commit 7ea2bb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sni.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"strings"
"time"

"github.com/fatih/color"
"github.com/golang/glog"
)

Expand Down Expand Up @@ -294,7 +295,11 @@ func createFile() {
func checkErr(messge string, err error, level int) {
if err != nil {
switch level {
case Info, Warning, Debug:
case Info:
color.Set(color.FgGreen)
defer color.Unset()
glog.Infoln(messge, err)
case Warning, Debug:
glog.Infoln(messge, err)
case Error:
glog.Fatalln(messge, err)
Expand Down

0 comments on commit 7ea2bb5

Please sign in to comment.