Asciidoctorj Extension: LOGGER?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Asciidoctorj Extension: LOGGER?

Jeremie Bresson
This post was updated on .
I am working on a simple extension written in Java something similar to the asciidoctorj-twitter-extension I have added into the maven examples repo. It takes some parameters and create a link.

My question is simple: in some cases (wrong parameter or unexpected state), I am not able to compute the link and I fallback to just a text. In the console I would like to log something:

asciidoctor: WARNING: <file>: line <n>: <my message>

Asciidoctor has already such warnings:

asciidoctor: WARNING: document.adoc: line 318: no callouts refer to list item 2

Is there some support in Java? I am writing code in a class extending org.asciidoctor.extension.InlineMacroProcessor.

I am for the moment using the 1.5.x API (migration to 1.6.x is planned)

Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctorj Extension: LOGGER?

mojavelinux
Administrator
This capability depends on https://github.com/asciidoctor/asciidoctor/issues/44.

I'd be happy to explore the idea of developing a interface on the AsciidoctorJ side until we can hook it up to core, but to do it right, core should be exposing a logger so that all messages can be made consistent.

If we need to bump this issue up in priority (such as for 1.5.5), I'm open to considering that possibility.

Cheers,

-Dan

On Wed, Feb 24, 2016 at 8:37 PM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I am working on a simple extension written in Java something similar to the asciidoctorj-twitter-extension I have added into the maven examples repo. It takes some parameters and create a link.

My question is simple: in some cases (wrong parameter or unexpected state), I am not able to compute the link and I fallback to just a text. In the console I would like to log something:

asciidoctor: WARNING: <file>: line <n>: <my message>

Asciidoctor has already such warnings:

asciidoctor: WARNING: document.adoc: line 318: no callouts refer to list item 2

Is there some support in Java? I am writing code in a class extending org.asciidoctor.extension.InlineMacroProcessor.

I am for the moment using the 1.5.x API (migration to 1.6.x is planned)




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Asciidoctorj-Extension-LOGGER-tp4401.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen