Merge pull request #55 from safing/fix/portmaster-control-date-format

Fix portmaster control date format
This commit is contained in:
Patrick Pacher 2020-05-26 10:43:39 +02:00 committed by GitHub
commit 0a89fb1b3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -81,7 +81,7 @@ func initControlLogFile() *os.File {
}
// open log file
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.log", time.Now().UTC().Format("2006-02-01-15-04-05")))
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.log", time.Now().UTC().Format("2006-01-02-15-04-05")))
return initializeLogFile(logFilePath, "control/portmaster-control", info.Version())
}
@ -100,7 +100,7 @@ func logControlError(cErr error) {
}
// open log file
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.error.log", time.Now().UTC().Format("2006-02-01-15-04-05")))
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.error.log", time.Now().UTC().Format("2006-01-02-15-04-05")))
errorFile := initializeLogFile(logFilePath, "control/portmaster-control", info.Version())
if errorFile == nil {
return
@ -121,7 +121,7 @@ func logControlStack() {
}
// open log file
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.stack.log", time.Now().UTC().Format("2006-02-01-15-04-05")))
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.stack.log", time.Now().UTC().Format("2006-01-02-15-04-05")))
errorFile := initializeLogFile(logFilePath, "control/portmaster-control", info.Version())
if errorFile == nil {
return

View file

@ -236,13 +236,13 @@ func execute(opts *Options, args []string) (cont bool, err error) {
log.Printf("failed to check/create log file dir %s: %s\n", logFileBasePath, err)
} else {
// open log file
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.log", time.Now().UTC().Format("2006-02-01-15-04-05")))
logFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.log", time.Now().UTC().Format("2006-01-02-15-04-05")))
logFile = initializeLogFile(logFilePath, opts.Identifier, file.Version())
if logFile != nil {
defer finalizeLogFile(logFile, logFilePath)
}
// open error log file
errorFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.error.log", time.Now().UTC().Format("2006-02-01-15-04-05")))
errorFilePath := filepath.Join(logFileBasePath, fmt.Sprintf("%s.error.log", time.Now().UTC().Format("2006-01-02-15-04-05")))
errorFile = initializeLogFile(errorFilePath, opts.Identifier, file.Version())
if errorFile != nil {
defer finalizeLogFile(errorFile, errorFilePath)