From 7456da964add0d6e8530ab731d5e8837dcfb8a54 Mon Sep 17 00:00:00 2001 From: ulrich Date: Sun, 01 Dec 2024 13:19:16 +0000 Subject: [PATCH] Logginglevel angepasst --- src/de/uhilger/neon/JarScanner.java | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/de/uhilger/neon/JarScanner.java b/src/de/uhilger/neon/JarScanner.java index e811183..f0cd8ab 100644 --- a/src/de/uhilger/neon/JarScanner.java +++ b/src/de/uhilger/neon/JarScanner.java @@ -59,32 +59,32 @@ } private void processZipEntry(ClassLoader urlCL, ZipEntry zipentry, String packageName, JarScannerListener l, Handler h, String contextName) { - log(Level.FINEST, zipentry.getName()); + finest(zipentry.getName()); String zName = zipentry.getName(); if (zName.toLowerCase().endsWith(".class")) { int pos = zName.indexOf(".class"); String fullClassName = zName.substring(0, pos); - log(Level.FINEST, "full class name: " + zName); + finest("full class name: " + zName); String fullClassNameDots = fullClassName.replace('/', '.'); - log(Level.FINEST, "full class name dots: " + fullClassNameDots); + finest("full class name dots: " + fullClassNameDots); String pkgName = getPackageName(fullClassNameDots); - log(Level.FINEST, " -- package name: " + pkgName); + finest(" -- package name: " + pkgName); if (null != urlCL && pkgName.toLowerCase().startsWith(packageName)) { Class c = null; try { c = urlCL.loadClass(fullClassNameDots); if (c != null) { if (c.isAnnotationPresent(Actor.class)) { - log(Level.FINER, " ---- ACTOR ---- " + fullClassNameDots); + finest(" ---- ACTOR ---- " + fullClassNameDots); l.actorFound(c, h, contextName); } else { - log(Level.FINER, "kein Actor " + fullClassNameDots); + finest("kein Actor " + fullClassNameDots); } } else { - log(Level.FINER, "class NOT loaded: " + zName); + finest("class NOT loaded: " + zName); } } catch (ClassNotFoundException ex) { - log(Level.FINER, " +++++ Class not found: " + ex.getMessage()); + finest(" +++++ Class not found: " + ex.getMessage()); } } } @@ -106,7 +106,7 @@ ClassLoader urlCL = null; try { url = getPath(c).toURL(); - log(Level.FINER, "url: " + url.getPath()); + finer("url: " + url.getPath()); urlCL = new URLClassLoader(new URL[]{url}); } catch (URISyntaxException ex) { log(Level.SEVERE, ex.getMessage()); @@ -120,14 +120,14 @@ public URI getPath(Class c) throws URISyntaxException { //Class c = this.getClass(); String className = c.getName(); - finer("this name: " + className); + finest("this name: " + className); int pos = className.indexOf(".class"); if(pos > -1) { String classNameWoExt = className.substring(0, pos); } String classNameWoPkg = className.substring(className.lastIndexOf(".") + 1); - finer("Class name: " + classNameWoPkg); + finest("Class name: " + classNameWoPkg); String classPath = c.getResource(classNameWoPkg + ".class").getPath(); pos = classPath.indexOf("!"); String jarPath; @@ -136,10 +136,14 @@ } else { jarPath = classPath; } - finer("path: " + jarPath); + finest("path: " + jarPath); return new URI(jarPath); } + private void finest(String msg) { + log(Level.FINEST, msg); + } + private void finer(String msg) { log(Level.FINER, msg); } -- Gitblit v1.9.3