Remove extra newlines when not logging