logging: refactor and add a loglevel.

Related: RhBug:1026035
logging: additional logging output on repo loading errors.

Related: RhBug:1026035