Do logging setup earlier so that messages during argument parsing are shown.

Also add a long style argument for enabling debug.
Merge pull request #80 from normanr/early-debug

Do logging setup earlier so that messages during argument parsing are shown.
fix merge conflict with upstream