后端日志格式更改 (#539)

This commit is contained in:
shaojie 2021-01-23 08:06:02 +08:00 committed by GitHub
parent 029f0a09ba
commit f0a4c130f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -269,6 +269,9 @@ func GetPatAndTimeFormat(tf string) (string, string) {
case "dd/mm/yyyy:HH:MM:SS":
pat = `([012][0-9]|3[01])/(0[1-9]|1[012])/(2[0-9]{3}):([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "02/01/2006:15:04:05"
case "mm-dd HH:MM:SS":
pat = `(0[1-9]|1[012])-([012][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
timeFormat = "01-02 15:04:05"
default:
logger.Errorf("match time pac failed : [timeFormat:%s]", tf)
return "", ""