Clean up code to treat log prints madness