7 from cement.core
import foundation
16 logger = logging.getLogger(APP_CONSTS.LOGGER_NAME)
17 logger.setLevel(logging.DEBUG)
20 ch = logging.StreamHandler()
21 ch.setLevel(logging.DEBUG)
24 formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
27 ch.setFormatter(formatter)
39 label =
'TestApplication' 44 PostProcessingApplicationClass.__init__(self, logger)
48 PostProcessingApplicationClass.setup(self)
52 PostProcessingApplicationClass.run(self)
57 self.
logger.info(APP_CONSTS.LOGGER_DELIMITER_LINE)
76 if __name__ ==
'__main__':
86 app.args.add_argument(
'-c',
'--config', action=
'store', metavar=
'config_file', help=
'config ini-file',
88 app.args.add_argument(
'-i',
'--inputFile', action=
'store', metavar=
'input_pickle_file', help=
'input pickle file',
95 exit_code = app.exitCode
97 except Exception, err:
98 logger.error(
"Exception: %s", str(err))
99 exit_code = APP_CONSTS.EXIT_FAILURE
101 logger.error(
'Unknown exception')
102 exit_code = APP_CONSTS.EXIT_FAILURE
104 logger.debug(
"exit_code = %s", str(exit_code))
def __init__(self, logger=None)