source: trip-planner-front/node_modules/less/lib/less-browser/log-listener.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.default = (function (less, options) {
4 var logLevel_debug = 4;
5 var logLevel_info = 3;
6 var logLevel_warn = 2;
7 var logLevel_error = 1;
8 // The amount of logging in the javascript console.
9 // 3 - Debug, information and errors
10 // 2 - Information and errors
11 // 1 - Errors
12 // 0 - None
13 // Defaults to 2
14 options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);
15 if (!options.loggers) {
16 options.loggers = [{
17 debug: function (msg) {
18 if (options.logLevel >= logLevel_debug) {
19 console.log(msg);
20 }
21 },
22 info: function (msg) {
23 if (options.logLevel >= logLevel_info) {
24 console.log(msg);
25 }
26 },
27 warn: function (msg) {
28 if (options.logLevel >= logLevel_warn) {
29 console.warn(msg);
30 }
31 },
32 error: function (msg) {
33 if (options.logLevel >= logLevel_error) {
34 console.error(msg);
35 }
36 }
37 }];
38 }
39 for (var i = 0; i < options.loggers.length; i++) {
40 less.logger.addListener(options.loggers[i]);
41 }
42});
43//# sourceMappingURL=log-listener.js.map
Note: See TracBrowser for help on using the repository browser.