Skip to content

Commit

Permalink
Add log package
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuki committed Oct 1, 2016
1 parent 0b54c8a commit 8b2c446
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package log

import (
"log"
)

var IsDebug = false

func init() {
log.SetFlags(0)
}

func Debug(v ...interface{}) {
if IsDebug == true {
log.Println(v...)
}
}

func Debugf(format string, v ...interface{}) {
if IsDebug == true {
log.Printf(format, v...)
}
}

func Info(v ...interface{}) {
log.Println(v...)
}

func Infof(format string, v ...interface{}) {
log.Printf(format, v...)
}

func Error(v ...interface{}) {
log.Fatal(v...)
}

func Errorf(format string, v ...interface{}) {
log.Fatalf(format, v...)
}

0 comments on commit 8b2c446

Please sign in to comment.