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

Ruby: log via Asciidoctor logger to provide the user with a file name #199

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

ahus1
Copy link
Contributor

@ahus1 ahus1 commented Jan 21, 2021

… and line number in the log, plus redirection of log content in IDEs.

I increased the "Metrics/AbcSize" as I didn't know a good refactoring for this method to stay below that limit. I'd appreciate a hint or help here.

Something I found: the log line will point at...

  • the first line of the block (the "----") for a block processor
  • the the block macro for block macro

I started to pass down this information to KrokiProcessor.process, but then Rubocop complained about too many parameters. Then I settled with "leave it as it is" :-/ ... see this snippet on how to adjust line numbers for logging.

@ahus1
Copy link
Contributor Author

ahus1 commented Jan 23, 2021

rebased, not sure why JS test failed in Windows - unstable test?

@ggrossetie
Copy link
Member

rebased, not sure why JS test failed in Windows - unstable test?

Probably, we might need to adjust the timeout...

@ggrossetie
Copy link
Member

I think we need to merge #171 first (or at least we will need to update #171 if we decide to merge this change first).

If you have time to review #171 that would be great. I did these changes to allow a better integration with GitLab. I guess the Intellij IDEA plugin would also benefit from these changes but I didn't check carefully.

@ggrossetie
Copy link
Member

I merged #171, we need to rebase this pull request.
If you want I can take care of it, just let me know 😉

@ggrossetie
Copy link
Member

@ahus1 Sorry I lost track but I think it's ready to go, right?

@ahus1
Copy link
Contributor Author

ahus1 commented Oct 16, 2021

@Mogztter - I've finally update the code, and updated also the other places where a logger was used.

To be able to use message_with_context I added include Asciidoctor::Logging in a total of 3 places.

I see that the code allows to pass a logger as a parameter. I had a look around and saw no code fragment using it. I wonder: What was the intention to not use the logger that is provided by include Asciidoctor::Logging? Did you plan to use a logger injection for testing?

I suppose it is now ready for review.

@ggrossetie
Copy link
Member

To be able to use message_with_context I added include Asciidoctor::Logging in a total of 3 places.

Sounds reasonable.

I see that the code allows to pass a logger as a parameter. I had a look around and saw no code fragment using it. I wonder: What was the intention to not use the logger that is provided by include Asciidoctor::Logging? Did you plan to use a logger injection for testing?

Yes, but also for integration. For instance, GitLab is using its own logger so it's important to be able to provide a different logger.

I suppose it is now ready for review.

OK, thanks, I will take a look.

Copy link
Member

@ggrossetie ggrossetie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻
I will wait a bit if someone else want to review before merging.

@ggrossetie ggrossetie merged commit eb4f22f into asciidoctor:master Oct 20, 2021
@ahus1 ahus1 deleted the asciidoctor-logger branch October 20, 2021 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants