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

Should be able to change severity for Java based messages #4468

Open
robander opened this issue Apr 26, 2024 · 1 comment
Open

Should be able to change severity for Java based messages #4468

robander opened this issue Apr 26, 2024 · 1 comment
Labels
feature New feature or request

Comments

@robander
Copy link
Member

Description

With DITA-OT 4.2, I'm able to override message severities. My use case for that is to set up a build gate as part of validation for documentation commits; issues that are allowed as warnings or errors for local / in-progress builds should be treated as fatal for pull request purposes. (We already use processing-mode strict, but this doesn't catch everything.)

When I change the severity of an XSLT message to Fatal, the message templates pick it up, and the build will fail if I throw the message. However the Java code will not do the same; because Java messages are thrown using logger.warn or logger.error, the message severity is part of the code itself, and modifying the severity in the message definition will have no effect.

For example, the Java code throws DOTX008E for missing images; I would like to set the severity of that to FATAL and use that to prevent merging any content with missing image references.

Possible Solution

It would be nice if the Java code was able to read the severity as well as the message text, so that when throwing an error, it could use that to determine error level.

@robander robander added the feature New feature or request label Apr 26, 2024
@jelovirt
Copy link
Member

Using LoggingEventBuilder might make the API more fluid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants