Custom "Log" tabs in Run Consoles

Hi,

I'm implementing a new Run Configuration and would like to add a custom tab to the run
console that has the ability to perform syntax highlighting on the displayed content. Is
adding such a tab possible with IDEA's (Open-)API?

Would it be possible to extend the log-viewer to assign a FileType to the displayed
output? That way also "normal" run configurations could make use of syntax highlighting
for log files. If there's a chance for this to be implemented, please let me know and I'll
file a request.

Thanks,
Sascha

8 comments

Hello Sascha,

I am going to provide some highlighting for 'log-viewer'. Any ideas are welcome.

Please, file a request.

Thank you.

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

Any takers?



0

Hello Anna,

I am going to provide some highlighting for 'log-viewer'. Any ideas are
welcome.


Thanks, that's great. Apart from the simple syntax coloring request, there are some more
enhancements I can think of, I'm just not sure if they're really needed:

- Custom tabs, totally unrelated to the log-viewer, i.e. the simple ability to plug any
JComponent into the Run Console.

- Ability (from OpenAPI) to get rid of the "Log: " prefix in the run console.

- RegEx based coloring. Maybe this could also be accomplished by allowing file types to be
defined by using regular expressions. (IDEABKL-2811)

- An interface that can feed data into the log-viewer without the requirement to use a
(temp) file. This would also eliminate the need to poll the data if I could supply the
viewer with an InputStream that it should read from.

What do you think?

Please, file a request.


Done for FileType-based highlighting: http://www.jetbrains.net/jira/browse/IDEA-5871

Sascha

0

Somewhat offtopic but slightly related: linking back to code:

http://www.jetbrains.net/jira/browse/IDEA-5822

;)
Thomas

Anna Kozlova wrote:

Hello Sascha,

I am going to provide some highlighting for 'log-viewer'. Any ideas are
welcome.
Please, file a request.

Thank you.

---------------------
Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

>> Any takers?
>>


0

Hello Sascha,

- Custom tabs, totally unrelated to the log-viewer, i.e. the simple ability

to plug any JComponent into the Run Console.

Do you have something concrete in mind? It is simple but I can't find a reason
to do it.

- Ability (from OpenAPI) to get rid of the "Log: " prefix in the run console.


Could you please file a request?

- RegEx based coloring. Maybe this could also be accomplished by allowing

file types to be defined by using regular expressions. (IDEABKL-2811)

I would think about it ;)

- An interface that can feed data into the log-viewer without the requirement

to use a (temp) file. This would also eliminate the need to poll the data
if I could supply the viewer with an InputStream that it should read from.

Are you talking about any 'Appender'?

Thank you.

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"


0

Hello Anna,

>> - Custom tabs, totally unrelated to the log-viewer, i.e. the simple
>> ability

to plug any JComponent into the Run Console.

Do you have something concrete in mind? It is simple but I can't find a
reason to do it.


Well, it would be the "low-level" solution for everything else I mentioned, plus anything
a plugin author can possibly think of. I could imagine a plugin that displays log4j output
in a table- or tree-like component, but I have no hard requirement for this, so it's your
choice if you want this to be extensible on this level.

>> - Ability (from OpenAPI) to get rid of the "Log: " prefix in the run
>> console.


Could you please file a request?


Done: http://www.jetbrains.net/jira/browse/IDEA-5938

>> - RegEx based coloring. Maybe this could also be accomplished by allowing

file types to be defined by using regular expressions. (IDEABKL-2811)

I would think about it ;)


That'd be great. Especially because IDEADEV-220 can only be considered "fixed" when
looking with one, half-closed eye at it (coloring, filtering) ;)

>> - An interface that can feed data into the log-viewer without the
>> requirement

to use a (temp) file. This would also eliminate the need to poll the
data if I could supply the viewer with an InputStream that it should
read from.

Are you talking about any 'Appender'?


Yes, kind of. The specific use case is that the process that's started might produce more
output than just stdout and stderr. The plugin would connect to that process on a socket
and the obtained InputStream could be directly fed into the log viewer.

Thinking this further, it turns out that this is exactly how the "normal" console output
works. There's already the ProcessHandler class and ConsoleView.attachTo(ProcessHandler).
With the ability to add a tab with a custom component, this would probably be quite easy
to accomplish.

The only question would be how the syntax coloring comes in here. Without anything better,
I'd probably try to plug a Lexer instance between the read output and the console, but
that's a bit ugly.

I hope I'm not totally off track here. Does that make any sense?


Sascha

0

Hello Anna,

after looking around a bit more I found a way to get my own tab into the console, plus I
also managed to integrate the syntax highlighters available from various file types. This
could certainly be improved for an easier use, but right now I'm quite happy with it.

Thanks for the inspiration :)

Sascha

0

Hi,

Sorry to wake up an old thread :)
Would it be possible to read the console log? Might sound weird, I would just be writting very custom plugin to interact with an app, and that's an easy way to interact (especially that I would plan on using it on AppCode with apps running on iOS simulator)

Thanks!

0

Please sign in to leave a comment.