From 99428f6f586269f4b5856f93adb71385f6c64c97 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 20 Dec 2013 11:20:39 +0100 Subject: singletons logic, logs and test cleanup/fixes --- netx/net/sourceforge/jnlp/util/logging/headers/Header.java | 13 +++++++++---- .../sourceforge/jnlp/util/logging/headers/PluginHeader.java | 9 +++------ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'netx/net/sourceforge/jnlp/util/logging/headers') diff --git a/netx/net/sourceforge/jnlp/util/logging/headers/Header.java b/netx/net/sourceforge/jnlp/util/logging/headers/Header.java index a87a14f..bb09f89 100644 --- a/netx/net/sourceforge/jnlp/util/logging/headers/Header.java +++ b/netx/net/sourceforge/jnlp/util/logging/headers/Header.java @@ -42,8 +42,9 @@ import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.logging.OutputController.Level; public class Header { - - public String user; + public static String default_user = System.getProperty("user.name"); + + public String user = default_user; public boolean application; public Level level; public Date date = new Date(); @@ -56,12 +57,15 @@ public class Header { public Header() { } + public Header(Level level, boolean isC) { + this(level, Thread.currentThread().getStackTrace(), Thread.currentThread(), isC); + } + public Header(Level level, StackTraceElement[] stack, Thread thread, boolean isC) { this(level, stack, thread, new Date(), isC); } public Header(Level level, StackTraceElement[] stack, Thread thread, Date d, boolean isC) { - this.user = System.getProperty("user.name"); this.application = JNLPRuntime.isWebstartApplication(); this.level = level; this.date = d; @@ -146,7 +150,8 @@ public class Header { result = stack[i];//at least moving up if (stack[i].getClassName().contains(OutputController.class.getName()) || //PluginDebug.class.getName() not avaiable during netx make - stack[i].getClassName().contains("sun.applet.PluginDebug")) { + stack[i].getClassName().contains("sun.applet.PluginDebug") + || stack[i].getClassName().contains(Header.class.getName())) { continue; } else { break; diff --git a/netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java b/netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java index 31ed19d..834085f 100644 --- a/netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java +++ b/netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java @@ -52,15 +52,12 @@ public class PluginHeader extends Header { static final Pattern whiteSpaces = Pattern.compile("\\s+"); static final Pattern threadsPattern = Pattern.compile("\\s+|,\\s*|:"); + @Override public String toString() { - if (preinit) { - return "!" + super.toString(); - } else { - return super.toString(); - } + return toString(true, true, true, true, true, true, true); } - + @Override public String toString(boolean userb, boolean originb, boolean levelb, boolean dateb, boolean callerb, boolean thread1b, boolean thread2b) { if (preinit) { -- cgit v1.2.3