git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3594 JAL-3728 Added taskbar icons to desktop and Java console. Changed "Jalview...
[jalview.git]
/
src
/
jalview
/
bin
/
Cache.java
diff --git
a/src/jalview/bin/Cache.java
b/src/jalview/bin/Cache.java
index
e96fef1
..
e6f86fe
100755
(executable)
--- a/
src/jalview/bin/Cache.java
+++ b/
src/jalview/bin/Cache.java
@@
-60,6
+60,7
@@
import jalview.schemes.ColourSchemes;
import jalview.schemes.UserColourScheme;
import jalview.structure.StructureImportSettings;
import jalview.urls.IdOrgSettings;
import jalview.schemes.UserColourScheme;
import jalview.structure.StructureImportSettings;
import jalview.urls.IdOrgSettings;
+import jalview.util.ChannelProperties;
import jalview.util.ColorUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.ColorUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
@@
-356,7
+357,8
@@
public class Cache
// lcastor.addAppender(ap);
// jalview.bin.Cache.log.addAppender(ap);
// Tell the user that debug is enabled
// lcastor.addAppender(ap);
// jalview.bin.Cache.log.addAppender(ap);
// Tell the user that debug is enabled
- jalview.bin.Cache.log.debug("Jalview Debugging Output Follows.");
+ jalview.bin.Cache.log.debug(ChannelProperties.getProperty("app_name")
+ + " Debugging Output Follows.");
} catch (Exception ex)
{
System.err.println("Problems initializing the log4j system\n");
} catch (Exception ex)
{
System.err.println("Problems initializing the log4j system\n");
@@
-661,8
+663,8
@@
public class Cache
new BuildDetails(codeVersion, null, codeInstallation);
if (printVersion && reportVersion)
{
new BuildDetails(codeVersion, null, codeInstallation);
if (printVersion && reportVersion)
{
- System.out.println(
- "Jalview Version: " + codeVersion + codeInstallation);
+ System.out.println(ChannelProperties.getProperty("app_name")
+ + " Version: " + codeVersion + codeInstallation);
}
}
}
}
@@
-829,7
+831,8
@@
public class Cache
lvclient.addAppender(log.getAppender("JalviewLogger"));
// Tell the user that debug is enabled
lvclient.addAppender(log.getAppender("JalviewLogger"));
// Tell the user that debug is enabled
- lvclient.debug("Jalview Vamsas Client Debugging Output Follows.");
+ lvclient.debug(ChannelProperties.getProperty("app_name")
+ + " Vamsas Client Debugging Output Follows.");
}
} catch (Exception e)
{
}
} catch (Exception e)
{
@@
-868,7
+871,8
@@
public class Cache
lgclient.addAppender(log.getAppender("JalviewLogger"));
// Tell the user that debug is enabled
lgclient.addAppender(log.getAppender("JalviewLogger"));
// Tell the user that debug is enabled
- lgclient.debug("Jalview Groovy Client Debugging Output Follows.");
+ lgclient.debug(ChannelProperties.getProperty("app_name")
+ + " Groovy Client Debugging Output Follows.");
}
} catch (Error e)
{
}
} catch (Error e)
{
@@
-930,7
+934,7
@@
public class Cache
.getConstructor(new Class[]
{ String.class, String.class, String.class })
.newInstance(new Object[]
.getConstructor(new Class[]
{ String.class, String.class, String.class })
.newInstance(new Object[]
- { "Jalview Desktop",
+ { ChannelProperties.getProperty("app_name") + " Desktop",
(vrs = jalview.bin.Cache.getProperty("VERSION") + "_"
+ jalview.bin.Cache.getDefault("BUILD_DATE",
"unknown")),
(vrs = jalview.bin.Cache.getProperty("VERSION") + "_"
+ jalview.bin.Cache.getDefault("BUILD_DATE",
"unknown")),
@@
-1206,10
+1210,12
@@
public class Cache
public static String getVersionDetailsForConsole()
{
StringBuilder sb = new StringBuilder();
public static String getVersionDetailsForConsole()
{
StringBuilder sb = new StringBuilder();
- sb.append("Jalview Version: ");
+ sb.append(ChannelProperties.getProperty("app_name"))
+ .append(" Version: ");
sb.append(jalview.bin.Cache.getDefault("VERSION", "TEST"));
sb.append("\n");
sb.append(jalview.bin.Cache.getDefault("VERSION", "TEST"));
sb.append("\n");
- sb.append("Jalview Installation: ");
+ sb.append(ChannelProperties.getProperty("app_name"))
+ .append(" Installation: ");
sb.append(jalview.bin.Cache.getDefault("INSTALLATION", "unknown"));
sb.append("\n");
sb.append("Build Date: ");
sb.append(jalview.bin.Cache.getDefault("INSTALLATION", "unknown"));
sb.append("\n");
sb.append("Build Date: ");
@@
-1400,11
+1406,11
@@
public class Cache
{
try
{
{
try
{
+ char[] displayHttpPw = new char[httpPassword == null ? 0
+ : httpPassword.length];
+ Arrays.fill(displayHttpPw, '*');
Cache.debug("CACHE Proxy: setting new Authenticator with httpUser='"
Cache.debug("CACHE Proxy: setting new Authenticator with httpUser='"
- + httpUser + "' httpPassword='"
- + (proxyAuthPassword == null ? "null"
- : new String(proxyAuthPassword))
- + "'"); // DELETE THIS LINE (password in logs)
+ + httpUser + "' httpPassword='" + displayHttpPw + "'");
Authenticator.setDefault(new Authenticator()
{
@Override
Authenticator.setDefault(new Authenticator()
{
@Override
@@
-1432,7
+1438,8
@@
public class Cache
.getString("label.proxy_password_required");
Preferences.openPreferences(Preferences.CONNECTIONS_TAB,
message);
.getString("label.proxy_password_required");
Preferences.openPreferences(Preferences.CONNECTIONS_TAB,
message);
- Preferences.getPreferences().proxyAuthPasswordFocus();
+ Preferences.getInstance()
+ .proxyAuthPasswordCheckHighlight(true, true);
}
else
{
}
else
{
@@
-1443,8
+1450,6
@@
public class Cache
&& getRequestingPort() == Integer
.valueOf(httpPort))
{
&& getRequestingPort() == Integer
.valueOf(httpPort))
{
- char[] displayHttpPw = new char[httpPassword.length];
- Arrays.fill(displayHttpPw, '*');
Cache.debug(
"AUTHENTICATOR returning PasswordAuthentication(\""
+ httpUser + "\", '"
Cache.debug(
"AUTHENTICATOR returning PasswordAuthentication(\""
+ httpUser + "\", '"
@@
-1495,6
+1500,9
@@
public class Cache
{
// reset the Authenticator to protect http.proxyUser and
// http.proxyPassword Just In Case
{
// reset the Authenticator to protect http.proxyUser and
// http.proxyPassword Just In Case
+ /* as noted above, due to bug in java this doesn't work if the sun.net.www.protocol.http.AuthCache
+ * has working credentials. No workaround for Java 11.
+ */
Cache.debug("AUTHENTICATOR setting default Authenticator to null");
Authenticator.setDefault(null);
}
Cache.debug("AUTHENTICATOR setting default Authenticator to null");
Authenticator.setDefault(null);
}
@@
-1527,25
+1535,32
@@
public class Cache
}
}
}
}
- public final static int DEBUG = 10;
+ public final static int TRACE = 10;
+
+ public final static int DEBUG = 20;
- public final static int INFO = 20;
+ public final static int INFO = 30;
- public final static int WARN = 30;
+ public final static int WARN = 40;
- public final static int ERROR = 40;
+ public final static int ERROR = 50;
public static boolean println(int level, String message)
{
if (Cache.log == null)
{
public static boolean println(int level, String message)
{
if (Cache.log == null)
{
- if (level >= ERROR)
+ if (level >= WARN)
System.err.println(message);
System.err.println(message);
- else
+ else if (level >= INFO)
System.out.println(message);
System.out.println(message);
+ // not printing debug or trace messages
return false;
}
return false;
}
- if (level >= WARN)
+ if (level >= ERROR)
+ {
+ Cache.log.error(message);
+ }
+ else if (level >= WARN)
{
Cache.log.warn(message);
}
{
Cache.log.warn(message);
}
@@
-1553,13
+1568,22
@@
public class Cache
{
Cache.log.info(message);
}
{
Cache.log.info(message);
}
- else
+ else if (level >= DEBUG)
{
Cache.log.debug(message);
}
{
Cache.log.debug(message);
}
+ else
+ {
+ Cache.log.trace(message);
+ }
return true;
}
return true;
}
+ public static void trace(String message)
+ {
+ println(TRACE, message);
+ }
+
public static void debug(String message)
{
println(DEBUG, message);
public static void debug(String message)
{
println(DEBUG, message);
@@
-1579,4
+1603,4
@@
public class Cache
{
println(ERROR, message);
}
{
println(ERROR, message);
}
-}
+}
\ No newline at end of file