|
@@ -1,4 +1,4 @@
|
1
|
|
-/* global $, config, getRoomName */
|
|
1
|
+/* global $, config, getRoomName, loggingConfig, JitsiMeetJS */
|
2
|
2
|
/* application specific logic */
|
3
|
3
|
const logger = require("jitsi-meet-logger").getLogger(__filename);
|
4
|
4
|
|
|
@@ -19,6 +19,8 @@ import 'aui-experimental-css';
|
19
|
19
|
|
20
|
20
|
window.toastr = require("toastr");
|
21
|
21
|
|
|
22
|
+const Logger = require("jitsi-meet-logger");
|
|
23
|
+
|
22
|
24
|
import URLProcessor from "./modules/config/URLProcessor";
|
23
|
25
|
import RoomnameGenerator from './modules/util/RoomnameGenerator';
|
24
|
26
|
|
|
@@ -32,6 +34,7 @@ import UIEvents from './service/UI/UIEvents';
|
32
|
34
|
import getTokenData from "./modules/tokendata/TokenData";
|
33
|
35
|
import translation from "./modules/translation/translation";
|
34
|
36
|
|
|
37
|
+
|
35
|
38
|
/**
|
36
|
39
|
* Tries to push history state with the following parameters:
|
37
|
40
|
* 'VideoChat', `Room: ${roomName}`, URL. If fail, prints the error and returns
|
|
@@ -79,6 +82,36 @@ function buildRoomName () {
|
79
|
82
|
return roomName;
|
80
|
83
|
}
|
81
|
84
|
|
|
85
|
+/**
|
|
86
|
+ * Adjusts the logging levels.
|
|
87
|
+ * @private
|
|
88
|
+ */
|
|
89
|
+function configureLoggingLevels () {
|
|
90
|
+ // NOTE The library Logger is separated from the app loggers, so the levels
|
|
91
|
+ // have to be set in two places
|
|
92
|
+
|
|
93
|
+ // Set default logging level
|
|
94
|
+ const defaultLogLevel
|
|
95
|
+ = loggingConfig.defaultLogLevel || JitsiMeetJS.logLevels.TRACE;
|
|
96
|
+ Logger.setLogLevel(defaultLogLevel);
|
|
97
|
+ JitsiMeetJS.setLogLevel(defaultLogLevel);
|
|
98
|
+
|
|
99
|
+ // NOTE console was used on purpose here to go around the logging
|
|
100
|
+ // and always print the default logging level to the console
|
|
101
|
+ console.info("Default logging level set to: " + defaultLogLevel);
|
|
102
|
+
|
|
103
|
+ // Set log level for each logger
|
|
104
|
+ if (loggingConfig) {
|
|
105
|
+ Object.keys(loggingConfig).forEach(function(loggerName) {
|
|
106
|
+ if ('defaultLogLevel' !== loggerName) {
|
|
107
|
+ const level = loggingConfig[loggerName];
|
|
108
|
+ Logger.setLogLevelById(level, loggerName);
|
|
109
|
+ JitsiMeetJS.setLogLevelById(level, loggerName);
|
|
110
|
+ }
|
|
111
|
+ });
|
|
112
|
+ }
|
|
113
|
+}
|
|
114
|
+
|
82
|
115
|
const APP = {
|
83
|
116
|
// Used by do_external_connect.js if we receive the attach data after
|
84
|
117
|
// connect was already executed. status property can be "initialized",
|
|
@@ -107,6 +140,7 @@ const APP = {
|
107
|
140
|
connection: null,
|
108
|
141
|
API,
|
109
|
142
|
init () {
|
|
143
|
+ configureLoggingLevels();
|
110
|
144
|
this.keyboardshortcut =
|
111
|
145
|
require("./modules/keyboardshortcut/keyboardshortcut");
|
112
|
146
|
this.configFetch = require("./modules/config/HttpConfigFetch");
|