pseudomodem: Improve dbus method logging further.

dbus-python catches exceptions raised when servicing a dbus remote call and
returns error to the remote caller. This hides the exceptions from the user of
the python module.

This CL adds a decorator that logs the return value (or error) of a dbus call
before returning it to the remote caller. This is the second attempt in this
regard. Improvements:
  - In the earlier impelementation, we missed out on base class implementations
    of the methods decorated with dbus.service.method
    This problem is not solved, but the new decorator must be used with the most
    concerete implementation of the function.
  - We now support logging the returns/errors sent asynchronously.

BUG=chromium:326394
TEST=(1) Run pseudomodem in standalone mode. Make sure you see logs from
         SimpleModem::Connect method.
     (2) Raise an exception in StateMachine::Step and make sure it gets logged.
     (3) Run pseudomodem autotests.

Change-Id: Ic00c03f03e1d902c2bd1b9bebd92f0411608d45b
Reviewed-on: https://chromium-review.googlesource.com/180085
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
13 files changed