Add logging functionality

A call of the function debugMode set the log level globally to ALL.
Add more documentation