thinkjs/lib/Lib/Core/Log.class.js
2013-10-31 10:15:18 +08:00

30 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 日志
* @type {[type]}
*/
module.exports = {
"EMERG": "EMERG", // 严重错误: 导致系统崩溃无法使用
"ALERT": "ALERT", // 警戒性错误: 必须被立即修改的错误
"CRIT": "CRIT", // 临界值错误: 超过临界值的错误例如一天24小时而输入的是25小时这样
"ERR": "ERR", // 一般错误: 一般性错误
"WARN": "WARN", // 警告性错误: 需要发出警告的错误
"NOTIC": "NOTIC", // 通知: 程序可以运行但是还不够完美的错误
"INFO": "INFO", // 信息: 程序输出信息
"DEBUG": "DEBUG", // 调试: 调试信息
"SQL": "SQL", // SQLSQL语句 注意只在调试模式开启时有效
log: [],
format: " [c] ",
record: function(message, level){
level = level || this.ERR;
this.log.push(level + ": " + message + "\r\n";)
},
save: function(type, destination, extra){
if (this.log.length == 0) {
return;
};
type = type || C('log_type');
},
write: function(){
}
}