Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary warnings when generating HRG-entries for abbreviations #40

Open
RieksJ opened this issue Feb 27, 2024 · 7 comments
Open

Unnecessary warnings when generating HRG-entries for abbreviations #40

RieksJ opened this issue Feb 27, 2024 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request impact: ALL tools

Comments

@RieksJ
Copy link
Member

RieksJ commented Feb 27, 2024

The TEv2-specifications uses 2 converters for generating its glossary: one for all terms in the MRG, and another one to sift out the abbreviations. The latter converter doesn't produce output for MRG entries that have an empty, or non-existent glossaryAbbr field, which is intended behavior. However, the HRGT does see that, and issues a warning (which would be helpful in other situations, but not in this one.

What are realistic, easy to implement possibilities for having a specific converter not generate such warnings?

@RieksJ RieksJ added the question Further information is requested label Feb 27, 2024
@RieksJ RieksJ added enhancement New feature or request and removed question Further information is requested labels Feb 29, 2024
@RieksJ
Copy link
Member Author

RieksJ commented Feb 29, 2024

Apart from this, in the log of the HRGT (and my guess would be that also holds for the TRRT), it is not clear which converter is generating a warning/info message. That would be really helpful.

So:

  • What are the possibilities for having a converterspec say that it doesn't need to generate a warning when it produces the empty string as output;
  • When a converter is producing a log line, it should be clear from that log line which converter does that.

@RieksJ RieksJ added the question Further information is requested label Mar 1, 2024
@Ca5e
Copy link
Member

Ca5e commented Mar 4, 2024

Giving some ideas here.
I suppose a solution would be to implement the built-in Handlebars helper log to have an option {{log level="silent"}}, that would somehow silence the warnings. This way we can also use tslog (the logger we use throughout the project) to log the errors instead of using the default that Handlebars uses to log to the console.
Another option would be to remove the warning by default and add a check that can trigger the log helper, something along the lines of: {{#ifValue ??? equals="???"}}{{log "Conversion of entry '" {{termid}} " using " err.converter " did not fill in any expression" level="warn"}}{{/ifValue}}.

@RieksJ
Copy link
Member Author

RieksJ commented Mar 5, 2024

Thanks for theses ideas. Pondering a bit about them, and the contexts in which they would be used, I would think that in cases where people are not that experienced with the tool, they would want to see warning messages (as we (I?) did at the start). Those that are sufficiently experienced that they know how to deal with converters etc. could use the first suggestion, ({{ log level="silent"}}), which for them would be easy enough to understand and use. I didn't know you could actually add such functionalities to built-in helpers, but if that's possible, then

@RieksJ RieksJ added documentation Improvements or additions to documentation impact: ALL tools and removed question Further information is requested labels Mar 5, 2024
Ca5e added a commit that referenced this issue Mar 9, 2024
Ca5e added a commit to tno-terminology-design/tev2-specifications that referenced this issue Mar 9, 2024
@Ca5e
Copy link
Member

Ca5e commented Mar 15, 2024

@RieksJ could you check if the documentation of the log helper function matches your idea of the implementation?

@RieksJ
Copy link
Member Author

RieksJ commented Mar 18, 2024

@Ca5e I've rewritten it a bit:

  • added texts regarding its purpose (what you can do with it);
  • attempted to write texts that won't put off non-developers
  • changed the examples - it seemed as if your examples didn't work (a <level> should be preceded with level=, right?)
    Can you review, correct any mistakes, and close this issue?

@RieksJ
Copy link
Member Author

RieksJ commented Apr 1, 2024

@Ca5e : can you check the boxes in this comment insofar appropriate (pls. check the texts I've redone, particularly for the log helper for correctness (and understandability)).

@RieksJ
Copy link
Member Author

RieksJ commented Apr 1, 2024

I have modified the HRGT converter configs of the tev2-specs repo to read as follows:

image

I would expect that adding the {{else}} clause in converter[2] would get rid of the logs, but it doesn't...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request impact: ALL tools
Projects
None yet
Development

No branches or pull requests

2 participants