I was missing the ability for logs like: `I0918 22:33:11.103850 23686 
main.go:39] Hello World!`
to let me click on the `path:line_number` and jump to the exact line of 
code that logged the message.

I noticed this linking was working for paths in messages from `panic`, so I 
dug into it. The reason this doesn't work is because Goland is looking for 
a path:line_number without the right-bracket (or any other suffix).

I filed a bug for 
this: 
https://youtrack.jetbrains.com/issue/GO-17484/Jump-to-source-from-terminal-logs-is-broken-but-easily-fixable

In the meantime I was able to get it working using the 
github.com/golang/glog <http://www.github.com/golang/glog> package by 
adding a space before the closing bracket in my local copy of its source:
https://github.com/golang/glog/blob/97303146a4ffecf364d4300e07fca855d0062c43/internal/logsink/logsink.go#L245

I thought I'd share in case anyone else found it helpful, or in case 
there's some better solution that I missed.

Omar

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6f74ec6e-a4a1-4fdd-afb1-10c74a7b176fn%40googlegroups.com.

Reply via email to