Edit the logging and debug output mechanism

Signed-off-by: Philip Luyckx <philip.luyckx@gmail.com>