A web blog and personal homepage engine written in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
797 B

// Package console implements a colorful logger for Gophertype.
package console
import "github.com/kirsle/golog"
var log *golog.Logger
func init() {
log = golog.GetLogger("gophertype")
log.Configure(&golog.Config{
Colors: golog.ExtendedColor,
Theme: golog.DarkTheme,
})
}
// SetDebug turns debug logging on or off.
func SetDebug(on bool) {
if on {
log.Config.Level = golog.DebugLevel
} else {
log.Config.Level = golog.InfoLevel
}
}
// Info level log.
func Info(msg string, v ...interface{}) {
log.Info(msg, v...)
}
// Debug level log.
func Debug(msg string, v ...interface{}) {
log.Debug(msg, v...)
}
// Warn level log.
func Warn(msg string, v ...interface{}) {
log.Warn(msg, v...)
}
// Error level log.
func Error(msg string, v ...interface{}) {
log.Error(msg, v...)
}