Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

adding a default category (lowest in priority) if a Y.log call is issed ... #800

Merged
merged 1 commit into from
Nov 28, 2012
Merged

Conversation

drewfish
Copy link
Contributor

this fixes the case when Y.log('msg') is call without a second argument

@caridy
Copy link
Contributor

caridy commented Nov 28, 2012

+1 :p

@caridy
Copy link
Contributor

caridy commented Nov 28, 2012

@isao is right, in fact logLevelOrder should be in config.json rather than in mojito.js directly. This is not part of this PR though.

@zhouyaoji
Copy link
Contributor

Unfortunately, It doesn't seem to fix the problem with Y.log("message w/o specifiying log level in second parameter") either. I installed 0.5.0pr5 and ran the sample logging app and again no message.

I added 'console.log(cat)' to the 'mojito.js' seen below and saw that 'cat' is undefined when the log level is not specified.

  Y.on('yui:log', function (e) {
        // we want to use Y.config instead of the original yuiConfig so
        // people can switch that value on runtime for debugging
        var c = Y.config,
            cat = e && e.cat && e.cat.toLowerCase();


        console.log(cat);  // => displays 'undefined' for Y.log("just a message, no log level");
        // applying logLevel filters

        // If 'cat' is undefined, log(c, e.msg., cat, e.src) is never executed.
        if (cat && ((c.logLevel === cat) || (c.logLevelOrder.indexOf(cat) >= 0))) {
            log(c, e.msg, cat, e.src);
        }

drewfish added a commit that referenced this pull request Nov 28, 2012
adding a default category (lowest in priority) if a Y.log call is issed ...
@drewfish drewfish merged commit 49e84bd into YahooArchive:develop Nov 28, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants