Skip to content

Commit

Permalink
Reduce log noise, even in debug mode (#11721)
Browse files Browse the repository at this point in the history
* Reduce log noise, even in debug mode

* remove line

---------

Co-authored-by: Subhramit Basu Bhowmick <[email protected]>
  • Loading branch information
Siedlerchr and subhramit authored Sep 7, 2024
1 parent 43c26ae commit d446b82
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}));

Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/theme/StyleSheetFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ static Optional<String> 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/xmp/XmpUtilReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private List<XMPMetadata> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
7 changes: 7 additions & 0 deletions src/main/resources/tinylog.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

[email protected] = error
[email protected] = error
[email protected] = warn
[email protected] = warn
[email protected] = info

#[email protected] = debug
#[email protected] = debug

Expand All @@ -15,6 +21,7 @@ [email protected] = debug
#[email protected] = debug

# AI debugging
#[email protected] = debug
#[email protected] = trace
#[email protected] = trace
#[email protected] = trace
Expand Down

0 comments on commit d446b82

Please sign in to comment.