git://git.nikiroo.be
/
fanfix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4102992
)
tracer: fix DEBUG=0
author
Niki Roo
<niki@nikiroo.be>
Sat, 13 Apr 2019 11:32:55 +0000
(13:32 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Sat, 13 Apr 2019 11:32:55 +0000
(13:32 +0200)
src/be/nikiroo/fanfix/Instance.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/Instance.java
b/src/be/nikiroo/fanfix/Instance.java
index a6f6fb75125404225cf8eed459f48d7cca282294..c547a2b121bdf07ae3e48ad146ad28ea07ed9c04 100644
(file)
--- a/
src/be/nikiroo/fanfix/Instance.java
+++ b/
src/be/nikiroo/fanfix/Instance.java
@@
-43,7
+43,9
@@
public class Instance {
static {
// Before we can configure it:
static {
// Before we can configure it:
- tracer = new TraceHandler(true, checkEnv("DEBUG"), checkEnv("DEBUG"));
+ Boolean debug = checkEnv("DEBUG");
+ boolean trace = debug != null && debug;
+ tracer = new TraceHandler(true, trace, trace);
// config dir:
configDir = getConfigDir();
// config dir:
configDir = getConfigDir();
@@
-53,19
+55,14
@@
public class Instance {
// Most of the rest is dependent upon this:
createConfigs(configDir, false);
// Most of the rest is dependent upon this:
createConfigs(configDir, false);
-
+
// Proxy support
Proxy.use(Instance.getConfig().getString(Config.USE_PROXY));
// update tracer:
// Proxy support
Proxy.use(Instance.getConfig().getString(Config.USE_PROXY));
// update tracer:
- boolean debug = Instance.getConfig()
- .getBoolean(Config.DEBUG_ERR, false);
- boolean trace = Instance.getConfig().getBoolean(Config.DEBUG_TRACE,
- false);
-
- if (checkEnv("DEBUG")) {
- debug = true;
- trace = true;
+ if (debug == null) {
+ debug = Instance.getConfig().getBoolean(Config.DEBUG_ERR, false);
+ trace = Instance.getConfig().getBoolean(Config.DEBUG_TRACE, false);
}
tracer = new TraceHandler(true, debug, trace);
}
tracer = new TraceHandler(true, debug, trace);
@@
-408,7
+405,8
@@
public class Instance {
trans.deleteFile(configDir);
}
trans.deleteFile(configDir);
}
- if (checkEnv("NOUTF")) {
+ Boolean noutf = checkEnv("NOUTF");
+ if (noutf != null && noutf) {
trans.setUnicode(false);
transGui.setUnicode(false);
}
trans.setUnicode(false);
transGui.setUnicode(false);
}
@@
-571,7
+569,7
@@
public class Instance {
*
* @return TRUE if it is
*/
*
* @return TRUE if it is
*/
- private static
b
oolean checkEnv(String key) {
+ private static
B
oolean checkEnv(String key) {
String value = System.getenv(key);
if (value != null) {
value = value.trim().toLowerCase();
String value = System.getenv(key);
if (value != null) {
value = value.trim().toLowerCase();
@@
-580,8
+578,10
@@
public class Instance {
|| "y".equals(value)) {
return true;
}
|| "y".equals(value)) {
return true;
}
+
+ return false;
}
}
- return
false
;
+ return
null
;
}
}
}
}