Make fop less verbose when building PDF

Started by Andres Freundabout 3 years ago4 messageshackers
Jump to latest
#1Andres Freund
andres@anarazel.de

Hi,

When building the pdf docs, fop emits a line for each page of the docs:

...
[INFO] FOUserAgent - Rendered page #2931.

which, given the length of our docs, makes the output pretty pointless. Even
if there are warnings, one likely won't notice them.

I just figured out that one can hide those. Unfortunately not at the
commandline, but in "$HOME/.foprc" or /etc.

$ cat ~/.foprc
LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=WARN

makes it a lot less annoying. And one can see that we currently are getting
warnings:

[warning] /usr/bin/fop: JVM flavor 'sun' not understood
[WARN] FOUserAgent - Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
[WARN] FOUserAgent - Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
[WARN] FOUserAgent - The contents of fo:block line 2 exceed the available area in the inline-progression direction by more than 50 points. (See position 30429:383)
[WARN] PropertyMaker - span="inherit" on fo:block, but no explicit value found on the parent FO.

The first is a debianism, the next two are possibly spurious [1]https://lists.apache.org/thread/yqkjzow3y8fpo9fc3hlbqb9fk49fonlf. But the next
two might be relevant?

I don't immediately see a way that's not too gross (like redefining HOME when
invoking fop) to set LOGLEVEL without editing .foprc. Perhaps we should add
advice to do so to docguide.sgml?

Greetings,

Andres Freund

[1]: https://lists.apache.org/thread/yqkjzow3y8fpo9fc3hlbqb9fk49fonlf

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#1)
Re: Make fop less verbose when building PDF

Andres Freund <andres@anarazel.de> writes:

I just figured out that one can hide those. Unfortunately not at the
commandline, but in "$HOME/.foprc" or /etc.

$ cat ~/.foprc
LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=WARN

Yeah. I've done it locally by modifying the "fop" script ;-)
... but probably ~/.foprc would be neater. I see that I also
changed the default logger:

LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

because at least in the version I have, that isn't the default.

[warning] /usr/bin/fop: JVM flavor 'sun' not understood
[WARN] FOUserAgent - Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
[WARN] FOUserAgent - Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
[WARN] FOUserAgent - The contents of fo:block line 2 exceed the available area in the inline-progression direction by more than 50 points. (See position 30429:383)
[WARN] PropertyMaker - span="inherit" on fo:block, but no explicit value found on the parent FO.

The first is a debianism, the next two are possibly spurious [1]. But the next
two might be relevant?

The one about "exceed the available area" has been on my radar to fix;
it's a consequence of an overly-wide example somebody added recently.
The other ones have been there all along and I don't know of a way to
get rid of them.

I don't immediately see a way that's not too gross (like redefining HOME when
invoking fop) to set LOGLEVEL without editing .foprc. Perhaps we should add
advice to do so to docguide.sgml?

+1

regards, tom lane

#3Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#2)
Re: Make fop less verbose when building PDF

Hi,

On 2023-03-24 16:19:57 -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

I just figured out that one can hide those. Unfortunately not at the
commandline, but in "$HOME/.foprc" or /etc.

$ cat ~/.foprc
LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=WARN

Yeah. I've done it locally by modifying the "fop" script ;-)
... but probably ~/.foprc would be neater. I see that I also
changed the default logger:

LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

because at least in the version I have, that isn't the default.

It might be a debian patch setting it as the default.

How about:

<para>
In its default configuration <productname>FOP</productname> will emit an
<literal>INFO</literal> message for each page. The log level can be
changed via <filename>~/.foprc</filename>:
<programlisting>
LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=WARN
</programlisting>
</para>

[warning] /usr/bin/fop: JVM flavor 'sun' not understood
[WARN] FOUserAgent - Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
[WARN] FOUserAgent - Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
[WARN] FOUserAgent - The contents of fo:block line 2 exceed the available area in the inline-progression direction by more than 50 points. (See position 30429:383)
[WARN] PropertyMaker - span="inherit" on fo:block, but no explicit value found on the parent FO.

The first is a debianism, the next two are possibly spurious [1]. But the next
two might be relevant?

The one about "exceed the available area" has been on my radar to fix;
it's a consequence of an overly-wide example somebody added recently.

Ah, good.

The other ones have been there all along and I don't know of a way to
get rid of them.

Yea, looks like the span="inherit" one is harmless and known:

https://issues.apache.org/jira/browse/FOP-1534

We could silence it in our stylesheet, but it's probably not worth bothering.

Greetings,

Andres Freund

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#3)
Re: Make fop less verbose when building PDF

Andres Freund <andres@anarazel.de> writes:

How about:

<para>
In its default configuration <productname>FOP</productname> will emit an
<literal>INFO</literal> message for each page. The log level can be
changed via <filename>~/.foprc</filename>:
<programlisting>
LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=WARN
</programlisting>
</para>

WFM.

regards, tom lane