executeScript and logging
Posted: 04 Dec 2013, 22:27
Hello
First off, thanks for making such an awesome program! I've been working on automating my media workflow using filebot and it's groovy scripts, I've made a lot of small custom scripts and now I would like to combine them in a postproccesing script.
In my scripts I use different logging levels and then I save the info level to individual log files. This works great when running the scripts from the command line like this:
My plan was to just run all the scripts using a linux bash script, but then I figured that it would be nicer with a cross-platform approach, using groovy. Looking at the functionality available, I've found the execute and the executeScript functions. It's easy to do what I want using the execute function, as I can then just launch a new instance of filebot with a given script and a defined logfile. However, filebot takes quite some time to initialize when launched, so launching a new instance for each script will delay the process a lot.
Using the executeScript function I can run the script and pass arguments and variables to it, without launching a new instance of filebot, but I would like to be able to log the output from each script to it's own log file.
My question, is it possible to define the loglevel and the logfile within a script, so I could somehow change it before executing each of the sub-scripts?
First off, thanks for making such an awesome program! I've been working on automating my media workflow using filebot and it's groovy scripts, I've made a lot of small custom scripts and now I would like to combine them in a postproccesing script.
In my scripts I use different logging levels and then I save the info level to individual log files. This works great when running the scripts from the command line like this:
Code: Select all
filebot -script scripts/script.groovy --log info --log-file script.log
Using the executeScript function I can run the script and pass arguments and variables to it, without launching a new instance of filebot, but I would like to be able to log the output from each script to it's own log file.
My question, is it possible to define the loglevel and the logfile within a script, so I could somehow change it before executing each of the sub-scripts?