Hi Ioannis,
Good questions.
>How
do I reduce the noise in the BioUno log? Both real errors and those
about missing property exceptions seems to be at the same log level.
In
the Java side that may be easier than in the Javascript. Unless you can
pinpoint one specific case, it is hard to confirm we are currently
logging detailed enough information. But if you are able to specify a
use case, the current behaviour, and how we could change it to make it
easier to debug issues; then it must be easier to assess whether that is
doable or not, and how complex it would be.
>How do I write debug messages to the BioUno log? (can I use a logger somehow)
Hummmm. Very interesting. I never thought about that, but you should be able to do that in your scripts.
```
// not tested, but along these lines...
import java.util.logging.Level; import java.util.logging.Logger;
def LOGGER = Logger.getLogger("org.biouno.myscript");
LOGGER.info("Hello");
LOGGER.log(Level.INFO, "Hello", exception);
```
>Other suggestions from people's experience in debugging while on the build form?
For
me the best way to debug problems with plug-ins is still importing the
source code into Eclipse, attaching the debugger and step through a few
parts of the code. It doesn't involve so much Java. Mainly knowing how
to use Maven, an IDE, how and where to put breakpoints, and some of the
Jenkins internal API (which you should be fine as you have been writing
Groovy in Jenkins for a while).
Hope that helps
Bruno
________________________________
From: Ioannis Moutsatsos <
imout...@gmail.com>
To: BioUno Developers <
biouno-d...@googlegroups.com>
Sent: Sunday, 2 April 2017 12:30 AM
Subject: [QUESTION]Best practices for debugging Active-Choices scripts?
Recently, I have been dealing with some AC groovy scripts that have proven tough to debug.
The BioUno log (even with v1.5.3) is littered with messages that this or the other AC parameter is missing. Real errors appear as well, embedded in there but in general are hard to find and hard to know exactly what script they originate in (all of them seem to reference Script1)
I also use the javascript console, and in general find it easier to understand where errors originate from as at least for the ones that have fall-back error scripts. For those, you can get the cascaded parameters and substitute into the script outside the build UI for testing.
I'm not sure if I'm doing these things in a very efficient manner. I would like to ask the following questions:
1. How do I reduce the noise in the BioUno log? Both real errors and those about missing property exceptions seems to be at the same log level.
2. How do I write debug messages to the BioUno log? (can I use a logger somehow)
3. Other suggestions from people's experience in debugging while on the build form?
Good suggestions and ideas should go into the Active Choices wiki troubleshooting page.
Thanks and best regards
Ioannis
--
You received this message because you are subscribed to the Google Groups "BioUno Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
biouno-develop...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.