def make_logger(self, level="INFO"):
        """
        Convenience function which creates a logger for the module.

        INPUTS:
        level   (default="INFO"):   Minimum log level for logged/streamed messages.

        OUTPUTS:
        logger                      Logger for the function. NOTE: Must be bound to variable named logger.
        """
        level = getattr(logging, level.upper())

        logger = logging.getLogger(__name__)
        logger.setLevel(logging.DEBUG)

        fh = logging.FileHandler('PyMORESANE.log', mode='w')
        fh.setLevel(level)

        ch = logging.StreamHandler()
        ch.setLevel(level)

        formatter = logging.Formatter('%(asctime)s [%(levelname)s]: %(''message)s', datefmt='[%m/%d/%Y] [%I:%M:%S]')
        fh.setFormatter(formatter)
        ch.setFormatter(formatter)

        logger.addHandler(fh)
        logger.addHandler(ch)

        return logger
def make_logger ( self , level = "INFO" ) : level = getattr ( logging , level . upper ( ) ) logger = logging . getLogger ( __name__ ) logger . setLevel ( logging . DEBUG ) fh = logging . FileHandler ( 'PyMORESANE.log' , mode = 'w' ) fh . setLevel ( level ) ch = logging . StreamHandler ( ) ch . setLevel ( level ) formatter = logging . Formatter ( '%(asctime)s [%(levelname)s]: %(' 'message)s' , datefmt = '[%m/%d/%Y] [%I:%M:%S]' ) fh . setFormatter ( formatter ) ch . setFormatter ( formatter ) logger . addHandler ( fh ) logger . addHandler ( ch ) return logger
Convenience function which creates a logger for the module.

        INPUTS:
        level   (default="INFO"):   Minimum log level for logged/streamed messages.

        OUTPUTS:
        logger                      Logger for the function. NOTE: Must be bound to variable named logger.