tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allison, Timothy B." <talli...@mitre.org>
Subject RE: svn commit: r1664641 - /tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
Date Fri, 06 Mar 2015 17:47:25 GMT
In the back of my memory, there's a ticket open for fixing the logged messages from PDFBox
(or maybe just fixing the pdfs that triggered the messages), but I can't find it quickly.
 It may have been a smaller part of something that we've already closed out, or it might still
be open.  

Tyler, in your impressive ticket-blitz of 2015, let me know if you find this. :)


Best,

         Tim
-----Original Message-----

From: Tyler Palsulich [mailto:tpalsulich@gmail.com] 
Sent: Friday, March 06, 2015 12:29 PM
To: dev@tika.apache.org
Cc: commits@tika.apache.org
Subject: Re: svn commit: r1664641 - /tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java

Thank you for this one... We can always turn it on later for debugging.

Tyler
On Mar 6, 2015 9:50 AM, <tallison@apache.org> wrote:

> Author: tallison
> Date: Fri Mar  6 14:50:46 2015
> New Revision: 1664641
>
> URL: http://svn.apache.org/r1664641
> Log:
> turn off pdfbox logging in PDFParserTest
>
> Modified:
>
> tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
>
> Modified:
> tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
> URL:
> http://svn.apache.org/viewvc/tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java?rev=1664641&r1=1664640&r2=1664641&view=diff
>
> ==============================================================================
> ---
> tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
> (original)
> +++
> tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
> Fri Mar  6 14:50:46 2015
> @@ -31,6 +31,8 @@ import java.util.Locale;
>  import java.util.Map;
>  import java.util.Set;
>
> +import org.apache.log4j.Level;
> +import org.apache.log4j.Logger;
>  import org.apache.tika.TikaTest;
>  import org.apache.tika.exception.AccessPermissionException;
>  import org.apache.tika.exception.EncryptedDocumentException;
> @@ -53,6 +55,8 @@ import org.apache.tika.sax.BasicContentH
>  import org.apache.tika.sax.BodyContentHandler;
>  import org.apache.tika.sax.ContentHandlerDecorator;
>  import org.apache.tika.sax.ToXMLContentHandler;
> +import org.junit.AfterClass;
> +import org.junit.BeforeClass;
>  import org.junit.Test;
>  import org.xml.sax.ContentHandler;
>  /**
> @@ -65,6 +69,20 @@ public class PDFParserTest extends TikaT
>      public static final MediaType TYPE_PDF = MediaType.application("pdf");
>      public static final MediaType TYPE_DOCX =
> MediaType.application("vnd.openxmlformats-officedocument.wordprocessingml.document");
>      public static final MediaType TYPE_DOC =
> MediaType.application("msword");
> +    public static Level PDFBOX_LOG_LEVEL = Level.INFO;
> +
> +    @BeforeClass
> +    public static void setup() {
> +        //remember default logging level, but turn off for PDFParserTest
> +        PDFBOX_LOG_LEVEL =
> Logger.getLogger("org.apache.pdfbox").getLevel();
> +        Logger.getLogger("org.apache.pdfbox").setLevel(Level.OFF);
> +    }
> +
> +    @AfterClass
> +    public static void tearDown() {
> +        //return to regular logging level
> +        Logger.getLogger("org.apache.pdfbox").setLevel(PDFBOX_LOG_LEVEL);
> +    }
>
>      @Test
>      public void testPdfParsing() throws Exception {
>
>
>
Mime
View raw message