More robust logging.

[IMPROVED]  Make logging more robust by catching any exceptions that result from dereferencing the arguments.