@staticmethod<EOL><INDENT>def setup_logger(log_level, log_file=None, logger_name=None):<DEDENT>
applogger = AppLog(logger_name)<EOL>level = getattr(logging, log_level.upper(), None)<EOL>if not level:<EOL><INDENT>color_print("<STR_LIT>" % log_level, "<STR_LIT>")<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>if level >= logging.INFO:<EOL><INDENT>sys.tracebacklimit = <NUM_LIT:0><EOL><DEDENT>if log_file:<EOL><INDENT>applogger._handle2file(log_file)<EOL><DEDENT>else:<EOL><INDENT>applogger._handle2screen(color = True)<EOL><DEDENT>applogger.logger.setLevel(level)<EOL>
setup logger
            @param log_level: debug/info/warning/error/critical
            @param log_file: log file path
            @param logger_name: the name of logger, default is 'root' if not specify