Skip to content

Commit

Permalink
CPLogPopup printed [null] as log level; removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsinger authored and Ross Boucher committed Dec 22, 2008
1 parent 4eb1490 commit 554aa77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Foundation/CPLog.j
Expand Up @@ -38,14 +38,15 @@ var _CPLogRegistrations = {};
var _CPFormatLogMessage = function(aString, aLevel, aTitle)
{
var now = new Date();
aLevel = ( aLevel == null ? '' : ' [' + aLevel + ']' );

if (typeof sprintf == "function")
return sprintf("%4d-%02d-%02d %02d:%02d:%02d.%03d %s [%s]: %s",
return sprintf("%4d-%02d-%02d %02d:%02d:%02d.%03d %s%s: %s",
now.getFullYear(), now.getMonth(), now.getDate(),
now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds(),
aTitle, aLevel, aString);
else
return now + " " + aTitle + " [" + aLevel + "]: " + aString;
return now + " " + aTitle + aLevel + ": " + aString;
}

// Register Functions:
Expand Down

0 comments on commit 554aa77

Please sign in to comment.