Changed logging behavioral in debug (-d) mode

Added logging facilities while in debug mode.
This helps to user (=developer) while find the origin of the log message.