new version with prettified log printing