From d446b82994be48b14d0d8795e1d8fc57f2863a93 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 7 Sep 2024 21:44:44 +0200 Subject: [PATCH] Reduce log noise, even in debug mode (#11721) * Reduce log noise, even in debug mode * remove line --------- Co-authored-by: Subhramit Basu Bhowmick --- src/main/java/org/jabref/gui/maintable/MainTable.java | 4 ++-- src/main/java/org/jabref/gui/theme/StyleSheetFile.java | 4 ++-- src/main/java/org/jabref/logic/xmp/XmpUtilReader.java | 2 +- .../model/search/Analyzer/LatexToUnicodeFoldingFilter.java | 2 +- src/main/resources/tinylog.properties | 7 +++++++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/jabref/gui/maintable/MainTable.java b/src/main/java/org/jabref/gui/maintable/MainTable.java index 91daebd7088..ecce71476de 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTable.java +++ b/src/main/java/org/jabref/gui/maintable/MainTable.java @@ -186,7 +186,7 @@ public MainTable(MainTableDataModel model, .filter(column -> column.getModel().equals(columnModel)) .findFirst() .ifPresent(column -> { - LOGGER.debug("Adding sort order for col {} ", column); + LOGGER.trace("Adding sort order for col {} ", column); this.getSortOrder().add(column); })); @@ -201,7 +201,7 @@ public MainTable(MainTableDataModel model, // Enable sorting model.getEntriesFilteredAndSorted().comparatorProperty().bind(this.comparatorProperty()); - this.getStylesheets().add(MainTable.class.getResource("MainTable.css").toExternalForm()); + this.getStylesheets().add(Objects.requireNonNull(MainTable.class.getResource("MainTable.css")).toExternalForm()); // Store visual state new PersistenceVisualStateTable(this, mainTablePreferences.getColumnPreferences()).addListeners(); diff --git a/src/main/java/org/jabref/gui/theme/StyleSheetFile.java b/src/main/java/org/jabref/gui/theme/StyleSheetFile.java index 0fb16e363c4..9401e51b18b 100644 --- a/src/main/java/org/jabref/gui/theme/StyleSheetFile.java +++ b/src/main/java/org/jabref/gui/theme/StyleSheetFile.java @@ -113,10 +113,10 @@ static Optional getDataUrl(URL url) { byte[] data = inputStream.readNBytes(MAX_IN_MEMORY_CSS_LENGTH); if (data.length < MAX_IN_MEMORY_CSS_LENGTH) { String embeddedDataUrl = DATA_URL_PREFIX + Base64.getEncoder().encodeToString(data); - LOGGER.debug("Embedded css in data URL of length {}", embeddedDataUrl.length()); + LOGGER.trace("Embedded css in data URL of length {}", embeddedDataUrl.length()); return Optional.of(embeddedDataUrl); } else { - LOGGER.debug("Not embedding css in data URL as the length is >= {}", MAX_IN_MEMORY_CSS_LENGTH); + LOGGER.trace("Not embedding css in data URL as the length is >= {}", MAX_IN_MEMORY_CSS_LENGTH); } } } catch (IOException e) { diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java index a5e4d009d32..a3c6e37a934 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java @@ -129,7 +129,7 @@ private List getXmpMetadata(PDDocument document) { try { metaList.add(XmpUtilShared.parseXmpMetadata(new ByteArrayInputStream(xmpMetaString.getBytes()))); } catch (IOException ex) { - LOGGER.warn("Problem parsing XMP schema. Continuing with other schemas.", ex); + LOGGER.debug("Problem parsing XMP schema. Continuing with other schemas.", ex); } } return metaList; diff --git a/src/main/java/org/jabref/model/search/Analyzer/LatexToUnicodeFoldingFilter.java b/src/main/java/org/jabref/model/search/Analyzer/LatexToUnicodeFoldingFilter.java index 786378ed344..5cd7fd64042 100644 --- a/src/main/java/org/jabref/model/search/Analyzer/LatexToUnicodeFoldingFilter.java +++ b/src/main/java/org/jabref/model/search/Analyzer/LatexToUnicodeFoldingFilter.java @@ -83,7 +83,7 @@ public static FoldingResult foldToUnicode(char[] input, int inputPos, int length char[] subArray = Arrays.copyOfRange(input, inputPos, inputPos + length); String s = new String(subArray); String result = FORMATTER.format(s); - LOGGER.debug("Folding {} to {}", s, result); + LOGGER.trace("Folding {} to {}", s, result); return new FoldingResult(result.toCharArray(), result.length()); } } diff --git a/src/main/resources/tinylog.properties b/src/main/resources/tinylog.properties index a1168dd1506..0d5ea5c4a90 100644 --- a/src/main/resources/tinylog.properties +++ b/src/main/resources/tinylog.properties @@ -7,6 +7,12 @@ writerConsole.format = {date} [{thread}] {class}.{method}()\n{level}: {message}\ # More shrunk exception logs. See https://tinylog.org/v2/configuration/#strip-stack-trace-elements for details exception = strip: jdk.internal +level@org.apache.pdfbox.pdmodel.font = error +level@org.apache.pdfbox.pdmodel.PDSimpleFont = error +level@org.apache.fontbox.util.autodetect.FontFileFinder = warn +level@org.apache.fontbox.ttf = warn +level@ai.djl = info + #level@org.jabref.model.entry.BibEntry = debug #level@org.jabref.gui.maintable.PersistenceVisualStateTable = debug @@ -15,6 +21,7 @@ level@org.jabref.http.server.Server = debug #level@org.jabref.gui.JabRefGUI = debug # AI debugging +#level@ai.djl = debug #level@org.jabref.gui.entryeditor.aichattab.AiChat = trace #level@org.jabref.gui.JabRefGUI = trace #level@org.jabref.logic.ai.AiService = trace