[WIP] logging via events

This allows to inject another logger when using as library, which in turn allows to use another logger (e.g. augment more information to the log lines or write to file/service).

If this style is okay, I'd change the logging style on all functions.