How can I view plugin log messages?

Answered

I'm testing the plugin by an autogenerated run config that launches another IDEA instance that has the plugin attached, these VM options are used:

-Xms128m -Xmx4096m -server -ea -Didea.system.path=/home/user/.macroannotation-ideaPluginIC/test-system -Didea.config.path=/home/user/.macroannotation-ideaPluginIC/test-config -Dsbt.ivy.home=/home/user/.ivy2 -Dplugin.path=/home/user/IdeaProjects/macroannotation_scala213/plugin/target/plugin/macroannotation-idea

 

I tried debug mode also, but I don't know where should I search for the log messages I generate in the plugin.

I use com.intellij.openapi.diagnostic.Logger, and use it like this:

private val Log = Logger.getInstance(classOf[TextBoxes])
Log.setLevel(Level.DEBUG)
Log.debug(s"TextBoxes loaded")

0
8 comments

Yann Cebron What if the plugin is published and you want to debug the released one? (as the owner of the plugin)

0

Dr.jacky You mean from installation of user? They will need to provide you log files manually from their machine.

0

Yann-Cebron What a coincidence, I happen to need to know the answer to this question.

My plug-in project runs normally in the sandbox, but errors occur in the actual software after it is released. I need to view the corresponding real-time logs locally. What is the solution?

Now I can only view the logs in real time through the logger.error method, which is really inconvenient.

0

yijie4188 Sorry I don't understand your situation. What is “in the actual software”? The plugin running in the user's IDE? Then see my previous reply.

0

Yann Cebron I compiled a plug-in, and then installed the plug-in on my local installation of WebStorm or IDEA.
What should I do if I want to view the logs like in Sandbox IDEA.

0

https://plugins.jetbrains.com/docs/intellij/ide-infrastructure.html#logging:

 

To locate the log file, choose the Help | Show Log in Finder/Explorer action. When internal mode is enabled, the currently running IDE log file can be opened using Help | Open Log in Editor.

1

Thank your help very much.

0

Please sign in to leave a comment.