github.com/wsand02/massren@v1.5.5-0.20191104203215-f721006d1e4e/log.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  var minLogLevel_ int
     8  
     9  func log(level int, s string, a ...interface{}) {
    10  	if level < minLogLevel_ {
    11  		return
    12  	}
    13  	fmt.Printf(APPNAME+": "+s+"\n", a...)
    14  }
    15  
    16  func logDebug(s string, a ...interface{}) {
    17  	log(0, s, a...)
    18  }
    19  
    20  func logInfo(s string, a ...interface{}) {
    21  	log(1, s, a...)
    22  }
    23  
    24  func logError(s string, a ...interface{}) {
    25  	log(3, s, a...)
    26  }