Source code for worldline.connect.sdk.log.communicator_logger

from abc import ABCMeta, abstractmethod


[docs]class CommunicatorLogger(object): """ Used to log messages from communicators. """ __metaclass__ = ABCMeta
[docs] def log_request(self, request_log_message): """ Logs a request message object """ self.log(request_log_message.get_message())
[docs] def log_response(self, response_log_message): """ Logs a response message object """ self.log(response_log_message.get_message())
[docs] @abstractmethod def log(self, message, thrown=None): """ Logs a throwable with an accompanying message. :param message: The message accompanying the throwable. :param thrown: The throwable to log. """ raise NotImplementedError