Logging function has to take place in a separate goroutine