wmo-im / pywcmp

pywcmp provides validation and quality assessment capabilities for the WMO WIS Core Metadata Profile (WCMP)
https://community.wmo.int/activity-areas/wis
Other
9 stars 8 forks source link

add logging facility for CLI #10

Closed tomkralidis closed 4 years ago

tomkralidis commented 4 years ago

cc @josusky

josusky commented 4 years ago

Hi Tom, your implementation of logging is more generic and cleaner than mine. I have only one complain. Information about file that is being validates is now printed to the standard output (using click.echo('Validating file {}'.format(file_))) but not not to the log file. So it is quite difficult to assign validation errors to files. Here is example of the log:

[2019-12-16T11:23:24Z] DEBUG - Validating <lxml.etree._ElementTree object at 0x7ff738af1dc8> against schema /home/josusky/.pywmcp/iso-all.xsd [2019-12-16T11:23:24Z] INFO - ASSERTION ERROR: Requirement 9.3.1: A WIS Discovery Metadata record describing data for global exchange via the WIS shall indicate the WMO Data License as Legal Constraint (type: "otherConstraints") using one and only one term from the WMO_DataLicenseCode code list. [2019-12-16T11:23:24Z] INFO - ASSERTION ERROR: Requirement 9.3.2: A WIS Discovery Metadata record describing data for global exchange via the WIS shall indicate the GTS Priority as Legal Constraint (type: "otherConstraints") using one and only one term from the WMO_GTSProductCategoryCode code list.

tomkralidis commented 4 years ago

Thanks for the feedback @josusky. Sorry I missed this. I pushed an update. Can you validate?