简体   繁体   中英

Log message/error at design-time in IntelliJ Idea?

I have had a problem with a custom component I am writing. The issue seems to be a resource not loading properly (not sure why) at design-time.

To track it down I'd like to put in some debug-code that will execute at design-time, and give output in form of some messages.

Is there a log or something similar that can be written to at design-time?

Thanks

There's a really nice trick you can use to add debug statements in IntelliJ without actually changing the code. The answer is to use non-suspending breakpoints.

Add a breakpoint at the necessary point in the code, then right click on it. De-select "Suspend", and then put whatever you want in the "Log evaluated expression" - this will give you access to the fields of the instance.

Run your app in debug mode, and you'll get debugging info in the console without having to manually examine everything.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM