Commit f27375ff authored by 谢宇轩's avatar 谢宇轩 😅

修改获取不到系统时区的bug

parent 628e38e9
...@@ -27,8 +27,11 @@ func FormatServiceWfLog(sourceKey string, message string) (Matedata, error) { ...@@ -27,8 +27,11 @@ func FormatServiceWfLog(sourceKey string, message string) (Matedata, error) {
mateItem.Topic = sourceKey mateItem.Topic = sourceKey
mateItem.Level = message[:levelIndex] mateItem.Level = message[:levelIndex]
message = message[levelIndex:] message = message[levelIndex:]
loc, _ := time.LoadLocation(Location) loc, err := time.LoadLocation(Location)
if err != nil {
loc = time.FixedZone("CST", 8*3600)
}
logTime, _ := time.ParseInLocation(": 06-01-02 15:04:05 ", message[:strings.Index(message, "[")], loc) logTime, _ := time.ParseInLocation(": 06-01-02 15:04:05 ", message[:strings.Index(message, "[")], loc)
mateItem.create = logTime mateItem.create = logTime
keyword := serviceWfLogKeyWord keyword := serviceWfLogKeyWord
...@@ -86,4 +89,4 @@ func DefaultJsonLog(sourceKey string, message string) (Matedata, error) { ...@@ -86,4 +89,4 @@ func DefaultJsonLog(sourceKey string, message string) (Matedata, error) {
result := *mateItem result := *mateItem
MatePool.Put(vMateItem) MatePool.Put(vMateItem)
return result, nil return result, nil
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment