]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/util/logging.js
Standardize on camelCase in Logging
[mirror_novnc.git] / core / util / logging.js
index fb2d417d7a2b6c9f0efa1383e12d345fc4bd3ce7..fe449e935154b6a1612ca4e6cdfec18801100517 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * noVNC: HTML5 VNC client
- * Copyright (C) 2012 Joel Martin
+ * Copyright (C) 2019 The noVNC Authors
  * Licensed under MPL 2.0 (see LICENSE.txt)
  *
  * See README.md for usage and integration instructions.
  * Logging/debug routines
  */
 
-let _log_level = 'warn';
+let _logLevel = 'warn';
 
 let Debug = () => {};
 let Info = () => {};
 let Warn = () => {};
 let Error = () => {};
 
-export function init_logging(level) {
+export function initLogging(level) {
     if (typeof level === 'undefined') {
-        level = _log_level;
+        level = _logLevel;
     } else {
-        _log_level = level;
+        _logLevel = level;
     }
 
     Debug = Info = Warn = Error = () => {};
@@ -40,17 +40,17 @@ export function init_logging(level) {
             case 'none':
                 break;
             default:
-                throw new Error("invalid logging type '" + level + "'");
+                throw new window.Error("invalid logging type '" + level + "'");
         }
         /* eslint-enable no-console, no-fallthrough */
     }
 }
 
-export function get_logging() {
-    return _log_level;
+export function getLogging() {
+    return _logLevel;
 }
 
 export { Debug, Info, Warn, Error };
 
 // Initialize logging level
-init_logging();
+initLogging();