ingomohr / docwriter

API to write docx documents
MIT License
1 stars 0 forks source link

Add Mechanism to Disable/Hide Warning- and Info-Logs from DOCX4J #71

Open ahmad2702 opened 1 year ago

ahmad2702 commented 1 year ago

For document generation, I use my existing template from my local machine. During generation I get a lot of the following logs:

2022-11-17 11:10:49,563 INFO  [org.doc.ope.con.ContentTypeManager] (vert.x-eventloop-thread-0) Detected WordProcessingML package
2022-11-17 11:10:49,564 INFO  [org.doc.ope.con.ContentTypeManager] (vert.x-eventloop-thread-0) Detected WordProcessingML package
2022-11-17 11:10:49,564 INFO  [org.doc.ope.io3.Load3] (vert.x-eventloop-thread-0) Instantiated package of type org.docx4j.openpackaging.packages.WordprocessingMLPackage
2022-11-17 11:10:49,565 INFO  [org.doc.ope.con.ContentTypeManager] (vert.x-eventloop-thread-0) Using DocPropsCustomPart ...
2022-11-17 11:10:49,568 INFO  [org.doc.ope.io3.Load3] (vert.x-eventloop-thread-0) package read;  elapsed time: 5 ms
2022-11-17 11:10:49,571 WARN  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) Parent of org.docx4j.wml.Tbl is currently org.docx4j.wml.Hdr not org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,572 INFO  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) setting to  org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,572 WARN  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) Parent of org.docx4j.wml.Tbl is currently org.docx4j.wml.Hdr not org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,573 INFO  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) setting to  org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,573 WARN  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) Parent of org.docx4j.wml.Tbl is currently org.docx4j.wml.Hdr not org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,574 INFO  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) setting to  org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,574 WARN  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) Parent of org.docx4j.wml.Tbl is currently org.docx4j.wml.Hdr not org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,574 INFO  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) setting to  org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,575 WARN  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) Parent of org.docx4j.wml.Tbl is currently org.docx4j.wml.Hdr not org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,575 INFO  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) setting to  org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,575 WARN  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) Parent of org.docx4j.wml.Tbl is currently org.docx4j.wml.Hdr not org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart
2022-11-17 11:10:49,576 INFO  [org.doc.TraversalUtil] (vert.x-eventloop-thread-0) setting to  org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart

It is required to add a mechanism/support to disable/hide such logs from docx4j.

The following markdown content can be used for the tests: md-content.md

ingomohr commented 1 year ago

Thank you @ahmad2702 for the feedback!

I'm not sure whether that is possible but I'll look into it. :)