This question is generic, and I would simply like to know how to dump objects to log files. In order to clarify things, i am elaborating through an example.
I have been
Perhaps you'd use var_export() function instead, like this:
var_export($shipment, 1); // to return the string without sending it to STDOUT
Also global functions cannot be called directly within double-quoted string. In your case,
Mage::log(var_export($shipment, 1) . '------', null, 'shipments.log')
would be ok, I guess. )
If the object you're trying to dump contains circular references, var_export() will fail, though. Then you can either use var_dump + ob_start/ob_flush combo (there are several examples at the var_dump() doc page), or take an alternate route with serialize() function.