Config for parsing output for file names / line numbers
Answered
Hi there,
PyCharm automatically generates a link to a source location from certain log output, e.g., from typical exception traceback outputs or lines like this:
some_rel_dir/source.py:100
Unfortunately, I'm forced to use a log output like this:
17:54:11.6 INFO config.add_parameters(33):
Is there any way to configure how log output is parsed for such source locations?
Cheers, Tom
Please sign in to leave a comment.
Hi Tom,
Could you please specify, do you mean "Tools| Analyze Stacktrace" functionality?
Hi Anna,
No, I don't mean the "Tools| Analyze Stacktrace" functionality. Let me elaborate on my explanation:
Some of my code produces lots of logging output like this:
where some_dir/source.py(681) refers to a Python source file and line 681. The "Run" panel displays this logging output but does not interpret this line as a reference to a source location, i.e., I cannot simply click on this reference and jump to this location as I would be able to do with a typical exception output.
I can tweak the output to some extent, but the "09:43:44.4 INFO" part keeps PyCharm from interpreting it as a source location. If you were to make the regex for identifying and interpreting such code references configurable, I could adapt it to my needs and the lines above would become links into my sources.
I hope that my request is clearer now.
Thanks for your time,
Tom
Hi Tom,
Thank you very much for the details.
Unfortunately, there is no such option now, please file a feature request about it to PyCharm issue tracker: https://youtrack.jetbrains.com/issues/PY and let me know if you have any problems with it.