When the log_level setting is not provided, fall back to the old
authorMike Taylor <mike@indexdata.com>
Tue, 25 Mar 2014 11:37:49 +0000 (11:37 +0000)
committerMike Taylor <mike@indexdata.com>
Tue, 25 Mar 2014 11:37:49 +0000 (11:37 +0000)
"debug_level" setting for backwards compatibility.

tools/htdocs/mkws.js

index 5c783a4..d03dcd5 100644 (file)
@@ -1371,10 +1371,14 @@ function team($, teamName) {
            dummy: "dummy"
        };
 
-       /* Set global log_level flag early so that log() works */
-       if (typeof mkws_config.log_level !== 'undefined') {
-           mkws.log_level = mkws_config.log_level;
-       } else if (typeof config_default.log_level !== 'undefined') {
+       // Set global log_level flag early so that log() works
+       // Fall back to old "debug_level" setting for backwards compatibility
+       var tmp = mkws_config.log_level;
+       if (typeof(tmp) === 'undefined') tmp = mkws_config.debug_level;
+
+       if (typeof(tmp) !== 'undefined') {
+           mkws.log_level = tmp;
+       } else if (typeof(config_default.log_level) !== 'undefined') {
            mkws.log_level = config_default.log_level;
        }