log library updated

master
fangdingjun 6 years ago
parent 96df0202b5
commit c50ba09949

@ -6,8 +6,6 @@ import (
"os" "os"
"github.com/fangdingjun/go-log" "github.com/fangdingjun/go-log"
"github.com/fangdingjun/go-log/formatters"
"github.com/fangdingjun/go-log/writers"
) )
func main() { func main() {
@ -26,7 +24,7 @@ func main() {
flag.Parse() flag.Parse()
if logfile != "" { if logfile != "" {
log.Default.Out = &writers.FixedSizeFileWriter{ log.Default.Out = &log.FixedSizeFileWriter{
MaxCount: logFileCount, MaxCount: logFileCount,
Name: logfile, Name: logfile,
MaxSize: logFileSize * 1024 * 1024, MaxSize: logFileSize * 1024 * 1024,
@ -42,9 +40,6 @@ func main() {
log.Default.Level = lv log.Default.Level = lv
} }
log.Default.Formatter = &formatters.TextFormatter{
TimeFormat: "2006-01-02 15:04:05.000"}
cfg, err := loadConfig(configfile) cfg, err := loadConfig(configfile)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)

Loading…
Cancel
Save