def main(): '''Set up logging and run the server.''' logging.basicConfig(level=logging.INFO) logging.info('ElectrumX server starting') try: controller = Controller(Env()) controller.run() except Exception: traceback.print_exc() logging.critical('ElectrumX server terminated abnormally') else: logging.info('ElectrumX server terminated normally')
def main(): '''Set up logging and run the server.''' log_fmt = Env.default('LOG_FORMAT', '%(levelname)s:%(name)s:%(message)s') logging.basicConfig(level=logging.DEBUG, format=log_fmt) logging.info('ElectrumX server starting') try: controller = Controller(Env()) controller.run() except Exception: traceback.print_exc() logging.critical('ElectrumX server terminated abnormally') else: logging.info('ElectrumX server terminated normally')
def main(): '''Set up logging and run the server.''' #logging.basicConfig(level=logging.DEBUG) logging.basicConfig(filename='aaa.log', level=logging.DEBUG, filemode='w') logging.info('ElectrumX server starting') try: controller = Controller(Env()) controller.run() except Exception: traceback.print_exc() logging.critical('ElectrumX server terminated abnormally') else: logging.info('ElectrumX server terminated normally')
def main(): '''Set up logging and run the server.''' logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)-7s %(message)-100s ' '[%(filename)s:%(lineno)d]') logging.info('ElectrumX server starting') try: controller = Controller(Env()) controller.run() except Exception: traceback.print_exc() logging.critical('ElectrumX server terminated abnormally') else: logging.info('ElectrumX server terminated normally')