-
Notifications
You must be signed in to change notification settings - Fork 172
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
Use the Asciidoctor logger from a Java Extension #737
Comments
I am curios about the use case, to see how best approach this. |
From the Ruby side, the design is to simply include the Asciidoctor::Logging module into any class. For example, here's how it's done in Asciidoctor PDF (ignore the shim logic). I'm not sure what the equivalent would be in Java. |
If logged warnings let the build fail in the asciidoctor-maven-plugin it would be just logical for me that an extension should also be able to emit such warnings. |
But the maven plugin captures logs messages. Here we are talking about publishing, I see this as a different thing. |
Yes, that’s exactly what I meant. I wonder if there’s a use case to pipe the log records through the ruby runtime or if these could just directly enter the java part. |
Personally I do not care if I get the same logger than the ruby one or if this is a pure Java implementation. As long as the warning I log in my extension go in the same list as the Ruby one, this is OK for me. |
I am trying the feature from an String warningMessage;
//... set value of warningMessage
log(new LogRecord(Severity.WARN, warningMessage)); I am wondering if there is a possibility to get access to the |
With asciidoctor/asciidoctor#44 a proper logger infrastructure has been added to Asciidoctor (ruby).
The logs can be accessed in AsciidoctorJ:
https://github.com/asciidoctor/asciidoctorj#logs-handling-api
I was wondering if the AsciidoctorJ extension I am writing can access the Logger and add an entry.
Quoting @robertpanzer:
The text was updated successfully, but these errors were encountered: