time-link / timelink-kleio

Provides translation of files in Kleio notation into XML and other formats. Part of Timelink.
1 stars 0 forks source link

More robust .err file format #2

Closed joaquimrcarvalho closed 8 months ago

joaquimrcarvalho commented 2 years ago

Current funcionality

err files contain the version of the translator, the date and the number of errors and warnings.

Example:

KleioTranslator - server version @@VERSION@@ - build @@BUILD@@ @@DATE@@
21-1-2022 16-35
0  errors. 
0  warnings.

older files can have just three lines, before warnings were introduced.

These files are processed by kleioFiles:more_attributes which assumes that the file has either 3 or 4 lines, and fails otherwise.

The problem is that the introduction of a line break in the build time tags @@VERSION@@ and @@BUILD@@ breaks the parsing of the .err file and has a result the file does not appear in calls to kleio server translations api.

Proposed enhancement

Prefix relevant information with tags to allow more robust parsing and future expansion:

translator:KleioTranslator - server version 
version:@@VERSION@@
build:@@BUILD@@ 
date:2022/01/21 16:35
errors:0 
warnings:0

Details

The first two lines of the current err files are generated by topLevel:pclio_version

The number of errors is generated by errors:perror_count

Additionally the topLevel:dat predicate could store the starting and end time of the translation so that the err file reports this information for performance monitoring:

translator:KleioTranslator - server version 
version:@@VERSION@@
build:@@BUILD@@ 
date:2022/01/21 16:35
errors:0 
warnings:0
start:2022/01/21 16:03
end:2022/01/21 16:35
joaquimrcarvalho commented 8 months ago

This was implemented in a more encompassing way with CLI_FILE_NAME.files.json translation results in 1d138c7, 0b4f171, 35d2f63