-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9b9aba
commit 928f612
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package net.osslabz.loggazer; | ||
|
||
import ch.qos.logback.classic.Level; | ||
import java.awt.Taskbar; | ||
import java.awt.Toolkit; | ||
import java.io.File; | ||
|
@@ -11,8 +12,6 @@ | |
import java.util.UUID; | ||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.Executors; | ||
|
||
import ch.qos.logback.classic.Level; | ||
import javafx.application.Application; | ||
import javafx.concurrent.Task; | ||
import javafx.scene.Scene; | ||
|
@@ -55,7 +54,7 @@ public class LogGazerApp extends Application { | |
|
||
public static final String SEARCH_QUERY_PLACEHOLDER = "Search..."; | ||
|
||
private static boolean loggingEnabled = false; | ||
private static boolean loggingDisabled = true; | ||
|
||
private final ExecutorService executor = Executors.newSingleThreadExecutor(); | ||
|
||
|
@@ -80,7 +79,7 @@ public class LogGazerApp extends Application { | |
|
||
public static void main(String[] args) { | ||
|
||
if (!loggingEnabled) { | ||
if (loggingDisabled) { | ||
disableLogging(); | ||
} | ||
|
||
|
@@ -90,7 +89,7 @@ public static void main(String[] args) { | |
String paramLowerCase = StringUtils.stripStart(singleParam.trim().toLowerCase(), "-"); | ||
if (paramLowerCase.equals("version") || paramLowerCase.equals("v")) { | ||
System.out.printf( | ||
""" | ||
""" | ||
log-gazer %s%n | ||
Copyright (C) 2024 Raphael Vullriede ([email protected])%n | ||
License: Apache License Version 2.0, January 2004 <https://www.apache.org/licenses/LICENSE-2.0.txt>.%n | ||
|
@@ -200,15 +199,15 @@ private ToolBar createToolBar() { | |
resetSearch(); | ||
|
||
toolBar.getItems().addAll( | ||
this.buttonFormatJson, | ||
new Separator(), | ||
this.buttonMarkLogLevel, | ||
new Separator(), | ||
this.searchField, | ||
this.searchButton, | ||
this.prevMatchButton, | ||
this.nextMatchButton, | ||
this.matchCountLabel | ||
this.buttonFormatJson, | ||
new Separator(), | ||
this.buttonMarkLogLevel, | ||
new Separator(), | ||
this.searchField, | ||
this.searchButton, | ||
this.prevMatchButton, | ||
this.nextMatchButton, | ||
this.matchCountLabel | ||
|
||
); | ||
|
||
|
@@ -262,7 +261,7 @@ private void navigateToCurrentMatch() { | |
int numMatches = tabContent.getSearchData().numMatches(); | ||
|
||
searchField.setText(StringUtils.isNotBlank(tabContent.getSearchData().getQuery()) ? tabContent.getSearchData().getQuery() : | ||
SEARCH_QUERY_PLACEHOLDER); | ||
SEARCH_QUERY_PLACEHOLDER); | ||
matchCountLabel.setText(String.format("%d of %d matches", currentMatchIndex + 1, numMatches)); | ||
|
||
if (currentMatchIndex >= 0 && currentMatchIndex < numMatches) { | ||
|
@@ -495,7 +494,7 @@ private void openFile() { | |
new FileChooser.ExtensionFilter("Compressed Files", "*.gz", "*.zip", "*.tar.gz") | ||
*/ | ||
new FileChooser.ExtensionFilter("Files", "*.*") | ||
new FileChooser.ExtensionFilter("Files", "*.*") | ||
|
||
); | ||
File file = fileChooser.showOpenDialog(null); | ||
|
@@ -506,13 +505,14 @@ private void openFile() { | |
|
||
|
||
public static void enableLogging() { | ||
loggingEnabled = true; | ||
|
||
loggingDisabled = false; | ||
} | ||
|
||
|
||
private static void disableLogging() { | ||
ch.qos.logback.classic.Logger rootLogger = | ||
(ch.qos.logback.classic.Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); | ||
|
||
ch.qos.logback.classic.Logger rootLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); | ||
rootLogger.setLevel(Level.OFF); | ||
} | ||
} |