AMC - Log update

All your suggestions, requests and ideas for future development
Post Reply
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

AMC - Log update

Post 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 ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC - Log update

Post 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.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: AMC - Log update

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC - Log update

Post 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
:idea: Please read the FAQ and How to Request Help.
Post Reply