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

Commit

Permalink
Merge pull request #800 from drewfish/log-level-fix
Browse files Browse the repository at this point in the history
adding a default category (lowest in priority) if a Y.log call is issed ...
  • Loading branch information
drewfish committed Nov 28, 2012
2 parents 1f2654d + f3ef893 commit 49e84bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mojito.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ MojitoServer.prototype._configureLogger = function(Y, yuiConfig) {
var c = Y.config,
cat = e && e.cat && e.cat.toLowerCase();

// this covers the case Y.log(msg) without category
// by using the low priority category from logLevelOrder.
cat = cat || c.logLevelOrder[0];

// applying logLevel filters
if (cat && ((c.logLevel === cat) || (c.logLevelOrder.indexOf(cat) >= 0))) {
log(c, e.msg, cat, e.src);
Expand Down

0 comments on commit 49e84bd

Please sign in to comment.