Skip to content

Commit d76ed61

Browse files
Michal SaloňMichalSalon
Michal Saloň
authored andcommitted
Fixed panic in logs with timestamp without milliseconds
1 parent fb23886 commit d76ed61

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [v1.0.37] - 2025-02-27
8+
9+
### Fixed
10+
- `service logs --messageType=WEBSERVER` should no longer panic
11+
712
## [v1.0.36] - 2025-02-26
813

914
### Improved

src/serviceLogs/handler_formatByRfc.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ func fixTimestamp(timestamp string) string {
5151
return timestamp
5252
}
5353
splitVal := strings.Split(timestamp, ".")
54-
millis := strings.Split(splitVal[1], "Z")[0]
55-
54+
millis := ""
55+
if len(splitVal) == 2 {
56+
millis = strings.Split(splitVal[1], "Z")[0]
57+
}
5658
for len(millis) < 6 {
5759
millis += "0"
5860
}

0 commit comments

Comments
 (0)