Closed ostefano closed 5 months ago
Apologies, the issue is not in this project, but in stix2validator where the following call takes place
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(message)s')
I can fix things by commenting out the following line inside options.py
from stix2validator.scripts import stix2_validator
Is there any way we can remove it?
Fix is now merged in related project 👍
The issue is due to creating the stream handler (and customizing the logger object) when one of the main modules (
__init__.py
andoptions.py
) is loaded.This is not correct, and while the logger object can be created at module loading time, customizations (including which formatter to use) should be moved to the script (executable) actually using the library.
For more examples see this other project which had a similar issue: https://github.com/davidonzo/apiosintDS/issues/2