From 6db5d818b0eea5381c6356a42091ec8c6920df0d Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 15 Jan 2019 11:05:24 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D1=83=D1=80=D0=BE=D0=B2=D0=BD=D0=B8?= =?UTF-8?q?=20=D0=BB=D0=BE=D0=B3=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D0=BD=D0=B5=D0=BA=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D1=8B=D1=85=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/gravit/launcher/client/ClientLauncher.java | 1 + .../java/ru/gravit/launcher/hasher/DirWatcher.java | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index c80c41c3..251cc728 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -409,6 +409,7 @@ public static Process launch( } args.add(JVMHelper.jvmProperty(LogHelper.DEBUG_PROPERTY, Boolean.toString(LogHelper.isDebugEnabled()))); args.add(JVMHelper.jvmProperty(LogHelper.STACKTRACE_PROPERTY, Boolean.toString(LogHelper.isStacktraceEnabled()))); + args.add(JVMHelper.jvmProperty(LogHelper.DEV_PROPERTY, Boolean.toString(LogHelper.isDevEnabled()))); if (LauncherConfig.ADDRESS_OVERRIDE != null) args.add(JVMHelper.jvmProperty(LauncherConfig.ADDRESS_OVERRIDE_PROPERTY, LauncherConfig.ADDRESS_OVERRIDE)); if (JVMHelper.OS_TYPE == OS.MUSTDIE) { diff --git a/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java b/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java index 582e7955..e4353e75 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/hasher/DirWatcher.java @@ -34,7 +34,6 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { FileVisitResult result = super.preVisitDirectory(dir, attrs); if (DirWatcher.this.dir.equals(dir)) { - LogHelper.subInfo("DirWatcher register V1 %s %s", dir.toString(), result.toString()); dir.register(service, KINDS); return result; } @@ -42,12 +41,10 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th // Maybe it's unnecessary to go deeper path.add(IOHelper.getFileName(dir)); if (matcher != null && !matcher.shouldVerify(path)) { - LogHelper.subInfo("DirWatcher skipped %s %s", dir.toString(), result.toString()); return FileVisitResult.SKIP_SUBTREE; } // Register - LogHelper.subInfo("DirWatcher register V2 %s %s", dir.toString(), result.toString()); dir.register(service, KINDS); return result; } @@ -124,7 +121,7 @@ private void processKey(WatchKey key) throws IOException { // Resolve paths and verify is not exclusion Path path = watchDir.resolve((Path) event.context()); - LogHelper.subInfo("DirWatcher event %s", path.toString()); + LogHelper.debug("DirWatcher event %s", path.toString()); Deque stringPath = toPath(dir.relativize(path)); if (matcher != null && !matcher.shouldVerify(stringPath)) continue; // Exclusion; should not be verified @@ -143,10 +140,10 @@ private void processKey(WatchKey key) throws IOException { } private void processLoop() throws IOException, InterruptedException { - LogHelper.info("WatchService start processing"); + LogHelper.debug("WatchService start processing"); while (!Thread.interrupted()) processKey(service.take()); - LogHelper.info("WatchService closed"); + LogHelper.debug("WatchService closed"); } @Override @@ -155,7 +152,7 @@ public void run() { try { processLoop(); } catch (InterruptedException | ClosedWatchServiceException ignored) { - LogHelper.info("WatchService closed 2"); + LogHelper.debug("WatchService closed 2"); // Do nothing (closed etc) } catch (Throwable exc) { handleError(exc);