From c25710115ec8f0321868773eb457594b848555e3 Mon Sep 17 00:00:00 2001 From: changwangss Date: Thu, 29 Aug 2024 00:13:18 -0700 Subject: [PATCH] add logger setting Signed-off-by: changwangss --- optimum/intel/neural_compressor/modeling_base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/optimum/intel/neural_compressor/modeling_base.py b/optimum/intel/neural_compressor/modeling_base.py index c2d1282177..67af0d3497 100644 --- a/optimum/intel/neural_compressor/modeling_base.py +++ b/optimum/intel/neural_compressor/modeling_base.py @@ -62,8 +62,11 @@ logger = logging.getLogger(__name__) handler = logging.StreamHandler() -formatter = logging.Formatter("%(levelname)s - %(message)s") +formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s", "%Y-%m-%d %H:%M:%S") handler.setFormatter(formatter) +logger.propagate = False +logger.addHandler(handler) +logger.setLevel(logging.INFO) MODEL_START_DOCSTRING = r""" This model check the superclass documentation for the generic methods the