added support for logging