From cc195c0c91bbe6f36d69409e6472e6d5d52200b0 Mon Sep 17 00:00:00 2001 From: r350178982 <32759763+r350178982@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:03:09 +0800 Subject: [PATCH] update --- app/log.py | 6 +++--- content_scanner/log.py | 4 ++-- ldap_syncer/run_ldap_sync.py | 4 ++-- repo_metadata/script/update_face_recognition.py | 2 +- seasearch/utils/__init__.py | 2 +- virus_scanner/run_virus_scan.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/log.py b/app/log.py index 69525b03..7a5bd1a1 100644 --- a/app/log.py +++ b/app/log.py @@ -25,8 +25,8 @@ def _rotating_config(self): def _basic_config(self): '''Log to stdout. Mainly for development.''' kw = { - 'format': '[%(asctime)s] [%(levelname)s] %(message)s', - 'datefmt': '%m/%d/%Y %H:%M:%S', + 'format': '[%(asctime)s] [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(message)s', + 'datefmt': '%Y-%m-%d %H:%M:%S', 'level': self._level, 'stream': sys.stdout } @@ -52,7 +52,7 @@ def add_face_recognition_logger(self, logfile): logger = logging.getLogger('face_recognition') handler = logging.handlers.TimedRotatingFileHandler(logfile, when='W0', interval=1) handler.setLevel(self._level) - formatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(message)s') + formatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(message)s', datefmt="%Y-%m-%d %H:%M:%S") handler.setFormatter(formatter) logger.setLevel(self._level) diff --git a/content_scanner/log.py b/content_scanner/log.py index 49215351..cffdcbc2 100644 --- a/content_scanner/log.py +++ b/content_scanner/log.py @@ -25,8 +25,8 @@ def _rotating_config(self): def _basic_config(self): '''Log to stdout. Mainly for development.''' kw = { - 'format': '[%(asctime)s] [%(levelname)s] %(message)s', - 'datefmt': '%m/%d/%Y %H:%M:%S', + 'format': '[%(asctime)s] [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(message)s', + 'datefmt': '%Y-%m-%d %H:%M:%S', 'level': self._level, 'stream': sys.stdout } diff --git a/ldap_syncer/run_ldap_sync.py b/ldap_syncer/run_ldap_sync.py index fb8527b1..0611046d 100644 --- a/ldap_syncer/run_ldap_sync.py +++ b/ldap_syncer/run_ldap_sync.py @@ -123,8 +123,8 @@ def run_ldap_sync(settings): parser.add_argument('-t', '--test', action='store_true') arg = parser.parse_args() kw = { - 'format': '[%(asctime)s] [%(levelname)s] %(message)s', - 'datefmt': '%m/%d/%Y %H:%M:%S', + 'format': '[%(asctime)s] [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(message)s', + 'datefmt': '%Y-%m-%d %H:%M:%S', 'level': logging.DEBUG, 'stream': sys.stdout } diff --git a/repo_metadata/script/update_face_recognition.py b/repo_metadata/script/update_face_recognition.py index 6c0bab43..e3452ba7 100644 --- a/repo_metadata/script/update_face_recognition.py +++ b/repo_metadata/script/update_face_recognition.py @@ -53,7 +53,7 @@ def update_face_info(face_recognition_manager, session): def init_logging(args): kw = { 'format': '%(asctime)s [%(levelname)s] %(name)s:%(lineno)s %(funcName)s: %(message)s', - 'datefmt': '%m/%d/%Y %H:%M:%S', + 'datefmt': '%Y-%m-%d %H:%M:%S', 'level': logging.INFO, 'stream': args.logfile } diff --git a/seasearch/utils/__init__.py b/seasearch/utils/__init__.py index 0e78e6b5..1af9d1ac 100644 --- a/seasearch/utils/__init__.py +++ b/seasearch/utils/__init__.py @@ -69,7 +69,7 @@ def init_logging(args): kw = { 'format': '%(asctime)s [%(levelname)s] %(name)s:%(lineno)s %(funcName)s: %(message)s', - 'datefmt': '%m/%d/%Y %H:%M:%S', + 'datefmt': '%Y-%m-%d %H:%M:%S', 'level': level, 'stream': args.logfile } diff --git a/virus_scanner/run_virus_scan.py b/virus_scanner/run_virus_scan.py index ac493737..f644e9fc 100644 --- a/virus_scanner/run_virus_scan.py +++ b/virus_scanner/run_virus_scan.py @@ -13,8 +13,8 @@ if __name__ == "__main__": kw = { - 'format': '[%(asctime)s] [%(levelname)s] %(message)s', - 'datefmt': '%m/%d/%Y %H:%M:%S', + 'format': '[%(asctime)s] [%(levelname)s] %(name)s:%(lineno)s %(funcName)s %(message)s', + 'datefmt': '%Y-%m-%d %H:%M:%S', 'level': logging.INFO, 'stream': sys.stdout }