Add log time format 02 / 01 / 2006:15:04:05 (#164)
* Add log time format 02 / 01 / 2006:15:04:05 * Server Add log time format 02 / 01 / 2006:15:04:05
This commit is contained in:
parent
36a24add6e
commit
eaf1d1be6d
|
@ -265,6 +265,9 @@ func GetPatAndTimeFormat(tf string) (string, string) {
|
||||||
case "mmdd HH:MM:SS":
|
case "mmdd 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}`
|
pat = `(0[1-9]|1[012])([012][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
|
||||||
timeFormat = "0102 15:04:05"
|
timeFormat = "0102 15:04:05"
|
||||||
|
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"
|
||||||
default:
|
default:
|
||||||
logger.Errorf("match time pac failed : [timeFormat:%s]", tf)
|
logger.Errorf("match time pac failed : [timeFormat:%s]", tf)
|
||||||
return "", ""
|
return "", ""
|
||||||
|
|
|
@ -508,6 +508,9 @@ func GetPatAndTimeFormat(tf string) (string, string) {
|
||||||
case "mmdd HH:MM:SS":
|
case "mmdd 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}`
|
pat = `(0[1-9]|1[012])([012][0-9]|3[01])\s([01][0-9]|2[0-4])(:[012345][0-9]){2}`
|
||||||
timeFormat = "0102 15:04:05"
|
timeFormat = "0102 15:04:05"
|
||||||
|
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"
|
||||||
default:
|
default:
|
||||||
logger.Errorf("match time pac failed : [timeFormat:%s]", tf)
|
logger.Errorf("match time pac failed : [timeFormat:%s]", tf)
|
||||||
return "", ""
|
return "", ""
|
||||||
|
|
Loading…
Reference in New Issue