]>
git.proxmox.com Git - mirror_novnc.git/blob - core/util/logging.js
2 * noVNC: HTML5 VNC client
3 * Copyright (C) 2012 Joel Martin
4 * Licensed under MPL 2.0 (see LICENSE.txt)
6 * See README.md for usage and integration instructions.
10 * Logging/debug routines
13 var _log_level
= 'warn';
15 var Debug = function (msg
) {};
16 var Info = function (msg
) {};
17 var Warn = function (msg
) {};
18 var Error = function (msg
) {};
20 export function init_logging (level
) {
21 if (typeof level
=== 'undefined') {
27 Debug
= Info
= Warn
= Error = function (msg
) {};
28 if (typeof window
.console
!== "undefined") {
32 Debug
= console
.debug
.bind(window
.console
);
34 Info
= console
.info
.bind(window
.console
);
36 Warn
= console
.warn
.bind(window
.console
);
38 Error
= console
.error
.bind(window
.console
);
42 throw new Error("invalid logging type '" + level
+ "'");
47 export function get_logging () {
50 export { Debug
, Info
, Warn
, Error
};
52 // Initialize logging level