From 7ad58c86cf38d66918e8fe00cb07e3bcb5ab2b71 Mon Sep 17 00:00:00 2001 From: syntron Date: Thu, 24 Apr 2025 20:54:21 +0200 Subject: [PATCH] [__init__] logging should be defined in the calling script reason: the calling script should define how logging is done; if these settings are added here and the caller adds another log handle (with possibly different settings), all log information could be printed twice or not at all --- OMPython/__init__.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/OMPython/__init__.py b/OMPython/__init__.py index a6964a9ba..29eaca991 100644 --- a/OMPython/__init__.py +++ b/OMPython/__init__.py @@ -36,27 +36,9 @@ CONDITIONS OF OSMC-PL. """ -import logging - from OMPython.OMCSession import OMCSessionBase, OMCSessionZMQ from OMPython.ModelicaSystem import ModelicaSystem, ModelicaSystemError, LinearizationResult -# Logger Defined -logger = logging.getLogger('OMPython') -logger.setLevel(logging.DEBUG) -# create console handler with a higher log level -logger_console_handler = logging.StreamHandler() -logger_console_handler.setLevel(logging.INFO) - -# create formatter and add it to the handlers -logger_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') -logger_console_handler.setFormatter(logger_formatter) - -# add the handlers to the logger -logger.addHandler(logger_console_handler) -logger.setLevel(logging.WARNING) - - # global names imported if import 'from OMPython import *' is used __all__ = [ 'ModelicaSystem',