From bd3f677a8316163e8599dd7a4ed46c1cf1e29e6a Mon Sep 17 00:00:00 2001 From: "li.zhenye" <李> Date: Tue, 9 Aug 2022 14:54:00 +0800 Subject: [PATCH] [fix] the main function and save picture tested --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 7a63381..1027b37 100755 --- a/main.py +++ b/main.py @@ -38,7 +38,7 @@ def main(only_spec=False, only_color=False): try: threshold = int(float(data)) Config.spec_size_threshold = threshold - logging.info('[INFO] Get spec threshold: ', threshold) + logging.info(f'[INFO] Get spec threshold: {threshold}') except Exception as e: logging.error(f'毁灭性错误:收到长度小于3却无法转化为整数spec_size_threshold的网络报文,报文内容为 {data},' f' 错误为 {e}.') @@ -116,9 +116,9 @@ if __name__ == '__main__': rgb_mask_fifo_path = '/tmp/dkmask_rgb.fifo' # logging相关 file_handler = logging.FileHandler(os.path.join(Config.root_dir, '.tobacco_algorithm.log')) - file_handler.setLevel(logging.DEBUG if args.d else logging.WARNING) + file_handler.setLevel(logging.WARNING) console_handler = logging.StreamHandler(sys.stdout) - console_handler.setLevel(logging.WARNING) + console_handler.setLevel(logging.DEBUG if args.d else logging.WARNING) logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', handlers=[file_handler, console_handler], level=logging.DEBUG) main(only_spec=args.os, only_color=args.oc)