From 0e791c7dfd28868d66a5f4da054b735ce4fa8e44 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 2 Sep 2024 14:28:15 +0500 Subject: [PATCH] Fix ifcopenshell.validate missing output in some cases after 07a0b4f Apparently adding LogDetectionHandler disabled default handler that prints the output. --- src/ifcopenshell-python/ifcopenshell/validate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index 6c78d7c063..295a2ba15a 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -524,9 +524,14 @@ def validate(f: Union[ifcopenshell.file, str], logger: Logger, express_rules=Fal class LogDetectionHandler(Handler): message_logged = False + def __init__(self): + super().__init__() + self.default_handler = logging.StreamHandler() + def emit(self, record): if not self.message_logged: self.message_logged = True + self.default_handler.emit(record) if __name__ == "__main__":