I was making a call to MochiKit.Logging.Logger.baseLog, using MochiKit.Logging.LogLevel?.* to specify the log level. Once this call reaches the function MochiKit.LoggingPane?.LoggingPane?.messageLevel, there is a problem mapping the LogLevel? constant to a useable value.
var messageLevel = function (msg) {
var level = msg.level;
if (typeof(level) == "number") {
level = MochiKit.Logging.LogLevel[level];
}
return level;
};
Here, it seems that if the provided log level is a number, it should be mapped to the corresponding text log level. However, this does not work. The variable "level" is set to undefined and the message is dropped.
I notice that internally, the log levels for the logging functions are set using a string literal and do not refer to LogLevel?. I am now doing the same, but it seems like the LogLevel? constants should be mapped correctly if used.