passgo/cmd/passgo-gui/log.go

29 lines
326 B
Go
Raw Permalink Normal View History

2019-09-05 06:41:39 -04:00
package main
import (
golog "log"
"os"
)
type logLevelT int
const (
Fatal logLevelT = 1 << iota
Error
Warn
Info
Debug
DebugGfx
)
var loglevel = Fatal | Error | Warn | Info
func log(level logLevelT, msg ...interface{}) {
if level&loglevel != 0 {
golog.Print(msg...)
}
if level&Fatal != 0 {
os.Exit(-1)
}
}