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

Reduce logging level when globals are not set. #3

Merged
2 commits merged into from
Jan 13, 2015
Merged

Conversation

dbdr
Copy link
Contributor

@dbdr dbdr commented Jan 12, 2015

jbig2-imageio currently logs a message at level info when globals are not set. The issue with this is that it's not necessarily an issue not to set them, in particular if they are passed as part of the image stream, but the info level is printed by default, leading to undesirable noise. When the globals are actually missing there will be another log entry: "SEVERE: No global segment added so far.". Therefore this pull request reduces the log level for this message.

It is not necessarily an issue, since globals can also
be part of the stream.
@ghost
Copy link

ghost commented Jan 13, 2015

The info is important for embedded JBIG2-compressed images. As you mentioned, it's not necessarily an issue in standalone files. As the main use-case for the plugin is the JBIG2Decode filtering in PDFs it is important. In the most logging systems you can set filters on classes, packages etc. My suggestion is to configure your logging system to ignore INFO messages at a reasonable scope.

@dbdr
Copy link
Contributor Author

dbdr commented Jan 13, 2015

Thanks for your answer, and sorry if I wasn't clear: the issue is not just for standalone images. For instance, the pdfbox library handles globals by concatenating them before the image content, so they work fine but you still get the INFO log entries even though it's irrelevant in that case. Configuring the logging system is fine if you are the end user, but I'm not sure it's a good idea when writing a library (for instance, the end user might replace the configuration with their own), and it's unreasonable to ask all end users to hide specific messages.

I agree it's important to log missing globals, but that is already done anyway when they are actually found to be missing. I just added a second commit to give more information in that log entry. Does this help?

ghost pushed a commit that referenced this pull request Jan 13, 2015
Reduce logging level when globals are not set.
@ghost ghost merged commit af04924 into levigo:master Jan 13, 2015
@jstray
Copy link

jstray commented Apr 28, 2016

I don't find this a helpful log message -- is there actually something different PDFBox could do to prevent my log from being spammed while processing PDFs with embedded JBIGs? They say no, that this is really a bug in jbig2-imageio: https://issues.apache.org/jira/browse/PDFBOX-2594

@theMattCode
Copy link

This is simply an INFO-level message. Most logging frameworks support filtering to suppress special messages.

@theMattCode
Copy link

By the way, the pull-request was accepted and merged. Any problems with the DEBUG-level anyway?

@jstray
Copy link

jstray commented Apr 28, 2016

All I know is that we now have two libraries who are each saying it's the other person's fault.

@ghost
Copy link

ghost commented Apr 29, 2016

Is there anything I miss in this discussion?

The pull-request was merged. The log level is on debug instead of info. In turn, end-user problems should be fixed by that.

This pull request was closed.
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.

3 participants