diff --git a/log/log.go b/log/log.go index 190c44c..2d41618 100644 --- a/log/log.go +++ b/log/log.go @@ -49,7 +49,7 @@ func newCore(level string) zapcore.Core { LineEnding: zapcore.DefaultLineEnding, EncodeLevel: zapcore.CapitalLevelEncoder, EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.SecondsDurationEncoder, // + EncodeDuration: zapcore.SecondsDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, EncodeName: zapcore.FullNameEncoder, } diff --git a/utils/utils.go b/utils/utils.go index 6c69963..6ab277d 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -139,6 +139,7 @@ func WriteFile(filename string, data []byte) error { func FormatFileName(dir, browser, filename, format string) string { r := strings.TrimSpace(strings.ToLower(filename)) + r = strings.Replace(r, " ", "_", -1) p := path.Join(dir, fmt.Sprintf("%s_%s.%s", r, browser, format)) return p } diff --git a/utils/utils_darwin.go b/utils/utils_darwin.go index f291851..576da17 100644 --- a/utils/utils_darwin.go +++ b/utils/utils_darwin.go @@ -80,20 +80,6 @@ func InitKey(key string) error { return err } -//func GetDBPath(dir string, dbName ...string) (dbFile []string) { -// for _, v := range dbName { -// s, err := filepath.Glob(dir + v) -// if err != nil && len(s) == 0 { -// continue -// } -// if len(s) > 0 { -// log.Debugf("Find %s File Success", v) -// log.Debugf("%s file location is %s", v, s[0]) -// dbFile = append(dbFile, s[0]) -// } -// } -// return dbFile -//} func decryptChromeKey(chromePass []byte) { chromeKey = pbkdf2.Key(chromePass, chromeSalt, 1003, 16, sha1.New) diff --git a/utils/utils_windows.go b/utils/utils_windows.go index f0bd489..603cc31 100644 --- a/utils/utils_windows.go +++ b/utils/utils_windows.go @@ -84,26 +84,6 @@ func InitKey(key string) error { } } -//func GetDBPath(dir string, dbName ...string) (dbFile []string) { -// var dbPath []string -// chromeDBPath := os.Getenv("USERPROFILE") + dir -// for _, v := range dbName { -// dbPath = append(dbPath, chromeDBPath+v) -// } -// for _, v := range dbPath { -// s, err := filepath.Glob(v) -// if err != nil && len(s) == 0 { -// continue -// } -// if len(s) > 0 { -// log.Debugf("Find %s File Success", v) -// log.Debugf("%s file location is %s", v, s[0]) -// dbFile = append(dbFile, s[0]) -// } -// } -// return dbFile -//} - func DecryptChromePass(encryptPass []byte) (string, error) { if len(encryptPass) > 15 { // remove prefix 'v10'