()
Initialize the logger to some file.
Initialize the logger to some file.
Initialize the logger to some file .
def logger_init():
    """
    Initialize the logger to some file.
    """
    logging.basicConfig(level=logging.INFO)

    logfile = 'logs/{}_{}.log'.format(time_stamp, config.LOG_DIR)
    fh = logging.FileHandler(logfile, mode='w')
    formatter = logging.Formatter("%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s")
    fh.setFormatter(formatter)
    logger.addHandler(fh)
def logger_init ( ) : logging . basicConfig ( level = logging . INFO ) logfile = 'logs/{}_{}.log' . format ( time_stamp , config . LOG_DIR ) fh = logging . FileHandler ( logfile , mode = 'w' ) formatter = logging . Formatter ( "%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s" ) fh . setFormatter ( formatter ) logger . addHandler ( fh )