Add support for external logging function