Page 1 of 1

AMC - Log update

Posted: 02 Jul 2017, 20:18
by kim
When using e.g. --def movieFormat=@"movieFormat.groovy"

the log will show ALL the format code from "movieFormat.groovy"
... so I updated to show like this:
Parameter: movieFormat = [[email protected]]
my code (Maybe not pretty, but it works):

Code: Select all

def formatType = []
_args.args.each{ n -> n =~ /=@/ ? formatType << n :'' }

_def.each{ n, v -> log.finest('Parameter: ' + [n, n =~ /plex|kodi|pushover|pushbullet|mail|myepisodes|.+Format/ ? n =~ /.+Format/ ? formatType : '*****' : v].join(' = ')) }
Can you make this official or if not just write how you would write the code ?

Re: AMC - Log update

Posted: 03 Jul 2017, 03:17
by rednoah
I'd log the format the FileBot sees, not the file path. Otherwise you'll make it impossible to find encoding issues, BOM issues, etc caused by bad groovy files.


I'd just use the log level to display some log messages and not others if it's too much output:

Code: Select all

--log info
Now you won't get all the FINEST log output, which is mainly helpful for debugging and reproducing errors.

Re: AMC - Log update

Posted: 04 Jul 2017, 01:37
by kim
Otherwise you'll make it impossible to find encoding issues, BOM issues, etc caused by bad groovy files
Well, If I try your way show ALL script code in log and fuck up my groovy file's format... it still just writes to the log... NO errors reported
So, why do it like that ?

add error checking, then I think a combination of your and my way is best:
check external groovy file for errors, if found log the error
else if no errors found, do NOT log full script, but just log the path/name of it

btw: my movieformat script is 54 lines of code

Re: AMC - Log update

Posted: 04 Jul 2017, 02:21
by rednoah
You're using --log ALL so it's just mirroring all the input arguments. If you don't want verbose logging, then you can just adjust the log level. ;)

e.g.

Code: Select all

--log-level FINER

Code: Select all

--log-level FINE

Code: Select all

--log-level INFO