pyfmu.fmi2.fmi2logging
¶
Defines logging related functionality
Module Contents¶
-
pyfmu.fmi2.fmi2logging.
_internal_log_catergory
= pyfmu¶
-
pyfmu.fmi2.fmi2logging.
_default_category
= events¶
-
class
pyfmu.fmi2.fmi2logging.
Fmi2StdLogCats
¶ Bases:
enum.Enum
Standard log categories defined in the FMI2 specification.
-
logEvents
= logEvents¶
-
logSingularLinearSystems
= logSingularLinearSystems¶
-
logNonlinearSystems
= logNonlinearSystems¶
-
logDynamicStateSelection
= logDynamicStateSelection¶
-
logStatusWarning
= logStatusWarning¶
-
logStatusDiscard
= logStatusDiscard¶
-
logStatusError
= logStatusError¶
-
logStatusFatal
= logStatusFatal¶
-
logStatusPending
= logStatusPending¶
-
logAll
= logAll¶
-
-
class
pyfmu.fmi2.fmi2logging.
Fmi2LoggerBase
¶ Bases:
abc.ABC
-
set_debug_logging
(self, logging_on: bool, categories: Iterable[str])¶
-
register_log_category
(self, category: str, aliases=None, predicate=None)¶ Registers a new log category
- Arguments:
category {str} – [description]
- Keyword Arguments:
aliases {[type]} – a list of aliases for the category (default: {None}) predicate {[type]} – a predicate function which takes as input a message and whether it should be logged. (default: {None})
-
log
(self, message: str, category: str = _default_category, status=Fmi2Status.ok)¶
-
_do_log
(self, message: str, category: str, status: Fmi2Status)¶
-
register_standard_categories
(self, categories: Iterable[str])¶ Registers the standard log categories defined by FMI2.
- Arguments:
categories {Iterable[str]} – A list of standard categories register. Possible values are: * logEvents * logNonlinearSystems * logNonlinearSystems * logDynamicStateSelection, * logStatusWarning * logStatusDiscard * logStatusError * logStatusFatal * logStatusPending * logAll
See 2.2.4 p.42 for reference
-
register_all_standard_categories
(self)¶ Convenience method used to register all standard FMI2 log categories
-
property
active_categories
(self)¶ Categories which are marked as active.
-
property
available_categories
(self)¶ Categories which have been declared by the FMU.
-
-
class
pyfmu.fmi2.fmi2logging.
Fmi2CallbackLogger
(callback, log_stdout=False)¶ Bases:
pyfmu.fmi2.fmi2logging.Fmi2LoggerBase
Class implementing the FMI2 logging system by providing methods to register and enable specific categories.
-
_do_log
(self, status, category, message)¶
-
-
class
pyfmu.fmi2.fmi2logging.
Fmi2NullLogger
¶ Bases:
pyfmu.fmi2.fmi2logging.Fmi2LoggerBase
-
log
(self, message, category: str = '', status=None)¶
-