Skip to content

Commit 6b51831

Browse files
committed
[__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
1 parent 0b63a2b commit 6b51831

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

OMPython/__init__.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,9 @@
3636
CONDITIONS OF OSMC-PL.
3737
"""
3838

39-
import logging
40-
4139
from OMPython.OMCSession import OMCSessionBase, OMCSessionZMQ
4240
from OMPython.ModelicaSystem import ModelicaSystem, ModelicaSystemError, LinearizationResult
4341

44-
# Logger Defined
45-
logger = logging.getLogger('OMPython')
46-
logger.setLevel(logging.DEBUG)
47-
# create console handler with a higher log level
48-
logger_console_handler = logging.StreamHandler()
49-
logger_console_handler.setLevel(logging.INFO)
50-
51-
# create formatter and add it to the handlers
52-
logger_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
53-
logger_console_handler.setFormatter(logger_formatter)
54-
55-
# add the handlers to the logger
56-
logger.addHandler(logger_console_handler)
57-
logger.setLevel(logging.WARNING)
58-
59-
6042
# global names imported if import 'from OMPython import *' is used
6143
__all__ = [
6244
'ModelicaSystem',

0 commit comments

Comments
 (0)