(self)
Configure logging.
        When no logfile argument is given we log to stdout.
Configure logging.
        When no logfile argument is given we log to stdout.
Configure logging . When no logfile argument is given we log to stdout .
def _configure_logging(self):
        """
        Configure logging.
        When no logfile argument is given we log to stdout.
        """
        self.log = logging.getLogger('airplayer')

        fmt = r"%(asctime)s [%(levelname)s] %(message)s"
        datefmt = r"%Y-%m-%d %H:%M:%S"

        if self._opts.logfile:
            handler = logging.FileHandler(self._opts.logfile)
        else:
            handler = logging.StreamHandler()

        if getattr(settings, 'DEBUG', None):
            loglevel = logging.DEBUG
        else:
            loglevel = logging.INFO
            
        self.log.setLevel(loglevel)
        handler.setFormatter(logging.Formatter(fmt, datefmt))
        self.log.addHandler(handler)
def _configure_logging ( self ) : self . log = logging . getLogger ( 'airplayer' ) fmt = r"%(asctime)s [%(levelname)s] %(message)s" datefmt = r"%Y-%m-%d %H:%M:%S" if self . _opts . logfile : handler = logging . FileHandler ( self . _opts . logfile ) else : handler = logging . StreamHandler ( ) if getattr ( settings , 'DEBUG' , None ) : loglevel = logging . DEBUG else : loglevel = logging . INFO self . log . setLevel ( loglevel ) handler . setFormatter ( logging . Formatter ( fmt , datefmt ) ) self . log . addHandler ( handler )