Fix logging function.