added possibility to log objects in debug mode