Limit recursion depth to avoid huge object dumps

Pretty printing with infinite recursion depth leads to massive log flood. This should avoid it.