This worked before b0d4ebe because --debug was given and the "args.loglevel.upper()" part was never executed. However, loglevel is expected as a string, not as an int.
b0d4ebe