Fix wrong console logging format assignment. Refs #5609.

Added some extra logging and error reporting in case of troubles.
Fix `NameError` on logging message.
Merge pull request #5650 from s0undt3ch/develop

Fix wrong console logging format assignment. Refs #5609.