'Proxies a log message to this Modem\'s logger, if one has been set.
This is useful for applications embedding pyGSM that wish to show
or log what\'s going on inside.
The *logger* should be a function with three arguments:
modem:   a reference to this GsmModem instance
message: the log message (a unicode string)
type:    a string contaning one of the keys
of GsmModem.LOG_LEVELS, indicating
the importance of this message.
GsmModem.__init__ accepts an optional "logger" kwarg, and a minimal
(dump to STDOUT) logger is available at GsmModem.logger:
>>> GsmModem("/dev/ttyUSB0", logger=GsmModem.logger)'

def _log(self, str_, type_='debug'):

    if hasattr(self, 'logger'):
        self.logger(self, str_, type_)
