[Pkg-javascript-commits] [less.js] 79/88: re-implement pull request #1701 - still allow log level to be configurable in dev mode

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:22:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v1.7.0
in repository less.js.

commit 18c49e7a0f04f2a778bd4a6fb8419ab8953aa24b
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Feb 23 16:12:27 2014 +0000

    re-implement pull request #1701 - still allow log level to be configurable in dev mode
---
 lib/less/browser.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/less/browser.js b/lib/less/browser.js
index b5902ca..dcfe498 100644
--- a/lib/less/browser.js
+++ b/lib/less/browser.js
@@ -21,11 +21,12 @@ var logLevel = {
 };
 
 // The amount of logging in the javascript console.
+// 3 - Debug, information and errors
 // 2 - Information and errors
 // 1 - Errors
 // 0 - None
 // Defaults to 2
-less.logLevel = typeof(less.logLevel) != 'undefined' ? less.logLevel : logLevel.debug;
+less.logLevel = typeof(less.logLevel) != 'undefined' ? less.logLevel : (less.env === 'development' ?  logLevel.debug : logLevel.errors);
 
 // Load styles asynchronously (default: false)
 //
@@ -58,7 +59,7 @@ var cache = null;
 var fileCache = {};
 
 function log(str, level) {
-    if (less.env == 'development' && typeof(console) !== 'undefined' && less.logLevel >= level) {
+    if (typeof(console) !== 'undefined' && less.logLevel >= level) {
         console.log('less: ' + str);
     }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list