what I want:
i want to use a logger in every script without having to initialize the logger every time
how it works
in a normal script task
the script format is groovy:
Logger log = LoggerFactory.getLogger(“irgendwas”);
as I want it to work
I only want to use the logger without any imports and initializations
Is it possible?
Create a class with the logger as a static field. Then import the class and access the logger through the static field ?
Thank you for the fast answer,
On the way you described i would still have to make an import in every bpmn script.
I am looking for a solution like the interface DelegateExecution that is available everywhere without imports
afaik, you will have to implement edits to how the Bindings are added into the Script Engine services. this will mean modifications to the engine’s internal apis.
so what do you mean is it even possible?
does anyone have an idea how to implement that
thank you in advance
Thank you that could work!
I will try it in the next few days
Ok, i think that will not work like that.
I have another idea
i want to intercept the output of print
script.out = IoBuilder.forLogger(“MyScript”).setLevel(Level.INFO).buildPrintWriter()
Do you know where the Groovy scripts are executed?