Skip to content

Commit

Permalink
Unescape URL in log message
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Mar 17, 2022
1 parent e6f9664 commit ca9a239
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions transpiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,14 @@ func (t *Transpiler) input() {
var logEvent LogEvent
e := c.LogEvent
if e.Span != nil {
url := e.Span.Url
if url == "" {
url = "stdin"
u := e.Span.Url
if u == "" {
u = "stdin"
}
u, _ = url.QueryUnescape(u)
logEvent = LogEvent{
Type: LogEventType(e.Type),
Message: fmt.Sprintf("%s:%d:%d: %s", url, e.Span.Start.Line, e.Span.Start.Column, c.LogEvent.GetMessage()),
Message: fmt.Sprintf("%s:%d:%d: %s", u, e.Span.Start.Line, e.Span.Start.Column, c.LogEvent.GetMessage()),
}
} else {
logEvent = LogEvent{
Expand Down

0 comments on commit ca9a239

Please sign in to comment.