mirror of
https://github.com/nxshock/backuper.git
synced 2024-11-28 00:21:02 +05:00
nxshock
19e809966a
* update logger routines * add index file support * split file masks and path masks
33 lines
395 B
Go
33 lines
395 B
Go
package main
|
|
|
|
import "log"
|
|
|
|
type LogLevel int
|
|
|
|
const (
|
|
Debug LogLevel = iota
|
|
Info
|
|
Warn
|
|
Error
|
|
)
|
|
|
|
func (b *Config) log(l LogLevel, a ...interface{}) {
|
|
if l < b.LogLevel {
|
|
return
|
|
}
|
|
|
|
log.Print(a...)
|
|
}
|
|
|
|
func (b *Config) logf(l LogLevel, s string, a ...interface{}) {
|
|
if l < b.LogLevel {
|
|
return
|
|
}
|
|
|
|
log.Printf(s, a...)
|
|
}
|
|
|
|
func (b *Config) fatalln(a ...interface{}) {
|
|
log.Fatalln(a...)
|
|
}
|