Chore: aggregate logger

This commit is contained in:
Dreamacro
2019-12-20 17:22:24 +08:00
parent eae06a4a7d
commit dd61e8d19d
3 changed files with 8 additions and 10 deletions

View File

@ -10,8 +10,7 @@ import (
"strings"
C "github.com/Dreamacro/clash/constant"
log "github.com/sirupsen/logrus"
"github.com/Dreamacro/clash/log"
)
func downloadMMDB(path string) (err error) {
@ -65,13 +64,13 @@ func Init(dir string) error {
// initial config.yaml
if _, err := os.Stat(C.Path.Config()); os.IsNotExist(err) {
log.Info("Can't find config, create an empty file")
log.Infoln("Can't find config, create an empty file")
os.OpenFile(C.Path.Config(), os.O_CREATE|os.O_WRONLY, 0644)
}
// initial mmdb
if _, err := os.Stat(C.Path.MMDB()); os.IsNotExist(err) {
log.Info("Can't find MMDB, start download")
log.Infoln("Can't find MMDB, start download")
err := downloadMMDB(C.Path.MMDB())
if err != nil {
return fmt.Errorf("Can't download MMDB: %s", err.Error())