Skip to content

Commit

Permalink
Fixed panic in logs with timestamp without milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Saloň authored and MichalSalon committed Feb 27, 2025
1 parent fb23886 commit d76ed61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.37] - 2025-02-27

### Fixed
- `service logs --messageType=WEBSERVER` should no longer panic

## [v1.0.36] - 2025-02-26

### Improved
Expand Down
6 changes: 4 additions & 2 deletions src/serviceLogs/handler_formatByRfc.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ func fixTimestamp(timestamp string) string {
return timestamp
}
splitVal := strings.Split(timestamp, ".")
millis := strings.Split(splitVal[1], "Z")[0]

millis := ""
if len(splitVal) == 2 {
millis = strings.Split(splitVal[1], "Z")[0]
}
for len(millis) < 6 {
millis += "0"
}
Expand Down

0 comments on commit d76ed61

Please sign in to comment.