Add purge logging facility
Merge pull request #12 from guillaumelecerf/logging

Looks good, thanks for the additional code changes.
Open the curl debug logfile in append mode, prevent logs to overwrite eachothers
Merge pull request #13 from guillaumelecerf/debug

Super, finally a useful log file output.