Extending the logging function