Skip to content
Browse files

updated to 0.3.3

  • Loading branch information...
1 parent ecb9d4b commit 8b3dfdb5b7615aadc285a0538e5dbda5cff45806 @baryon committed Mar 9, 2012
Showing with 24 additions and 20 deletions.
  1. +7 −3 README.md
  2. +1 −1 example/file.js
  3. +1 −1 example/mongodb.js
  4. +1 −1 example/stream.js
  5. +2 −2 lib/console.js
  6. +1 −1 package.json
  7. +11 −11 test/test.js
View
10 README.md
@@ -250,7 +250,7 @@ and the filters is an array, the last item can be custom filter. see example:[fi
var fs = require('fs');
var logger = require('tracer').console({
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
fs.open('./file.log', 'a', 0666, function(e, id) {
fs.write(id, data.output+"\n", null, 'utf8', function() {
@@ -275,7 +275,7 @@ logger.error('hello %s %d %j', 'world', 123, {foo : 'bar'}, [ 1, 2, 3, 4 ], Obje
var fs = require('fs');
var logger = require('tracer').console({
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
var stream = fs.createWriteStream("./stream.log", {
flags: "a",
@@ -300,7 +300,7 @@ var mongo = require('mongoskin');
var db = mongo.db("127.0.0.1:27017/test?auto_reconnect");
var log_conf = {
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
var loginfo = db.collection("loginfo");
loginfo.insert( data, function(err, log) {
@@ -347,6 +347,10 @@ module.exports = function(conf) {
## History
+### 0.3.3
+
+* speel missing (transpot->transport)
+
### 0.3.2
* speed-up for _log function
View
2 example/file.js
@@ -1,7 +1,7 @@
var fs = require('fs');
var logger = require('tracer').console({
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
fs.open('./file.log', 'a', 0666, function(e, id) {
fs.write(id, data.output+"\n", null, 'utf8', function() {
View
2 example/mongodb.js
@@ -2,7 +2,7 @@ var mongo = require('mongoskin');
var db = mongo.db("127.0.0.1:27017/test?auto_reconnect");
var log_conf = {
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
var loginfo = db.collection("loginfo");
loginfo.insert( data, function(err, log) {
View
2 example/stream.js
@@ -1,7 +1,7 @@
var fs = require('fs');
var logger = require('tracer').console({
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
var stream = fs.createWriteStream("./stream.log", {
flags: "a",
View
4 lib/console.js
@@ -5,7 +5,7 @@ module.exports = (function() {
var _config = {
format : "{{timestamp}} <{{title}}> {{file}}:{{line}} ({{method}}) {{message}}",
dateformat : "yyyy-mm-dd'T'HH:MM:ss.L'Z'",
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
},
filters : [],
@@ -63,7 +63,7 @@ module.exports = (function() {
// null, undefined)
}
// trans the final result
- return _config.transpot(data);
+ return _config.transport(data);
};
var _self = {};
View
2 package.json
@@ -2,7 +2,7 @@
"name": "tracer",
"description": "A powerful and customizable logging library for node.js. support color console with timestamp, line number, method name, file name and call stack. you can set transport to file, stream, database(ex: mongodb and clouddb, simpledb). keywords: log, logger, trace ",
"homepage": "http://github.com/baryon/tracer",
- "version": "0.3.2",
+ "version": "0.3.3",
"author": "LI Long <lilong@gmail.com>",
"dependencies": {
"dateformat": "1.0.2-1.2.3",
View
22 test/test.js
@@ -3,7 +3,7 @@ var assert = require("assert");
exports["simple message"] = function() {
var logger = require('../').console({
format : "{{message}}",
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
return data;
}
@@ -15,7 +15,7 @@ exports["simple message"] = function() {
exports["simple console message"] = function() {
var logger = require('../').colorConsole({
format : "{{message}}",
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
return data;
}
@@ -27,7 +27,7 @@ exports["simple console message"] = function() {
exports["console log method"] = function() {
var logger = require('../').console({
format : "{{message}}",
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
return data;
}
@@ -47,7 +47,7 @@ exports["custom format"] = function() {
error : "error:{{message}}",
}
],
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
return data;
}
@@ -76,7 +76,7 @@ exports["custom filter"] = function() {
warn : colors.yellow,
error : [colors.red, colors.bold ]
}],
- transpot : function(data) {
+ transport : function(data) {
console.log(data.output);
return data;
}
@@ -91,7 +91,7 @@ exports["custom filter"] = function() {
exports["set level to log"] = function() {
var logger = require('../').console({level:'log',
- transpot : function(data) {
+ transport : function(data) {
return data;
}
});
@@ -104,7 +104,7 @@ exports["set level to log"] = function() {
}
exports["set level to 0"] = function() {
var logger = require('../').console({level:0,
- transpot : function(data) {
+ transport : function(data) {
return data;
}
});
@@ -117,7 +117,7 @@ exports["set level to 0"] = function() {
}
exports["set level to 2"] = function() {
var logger = require('../').console({level:2,
- transpot : function(data) {
+ transport : function(data) {
return data;
}
});
@@ -130,7 +130,7 @@ exports["set level to 2"] = function() {
}
exports["set level to warn"] = function() {
var logger = require('../').console({level:'warn',
- transpot : function(data) {
+ transport : function(data) {
return data;
}
});
@@ -143,7 +143,7 @@ exports["set level to warn"] = function() {
}
exports["set level to error"] = function() {
var logger = require('../').console({level:'error',
- transpot : function(data) {
+ transport : function(data) {
return data;
}
});
@@ -156,7 +156,7 @@ exports["set level to error"] = function() {
}
exports["set level to max value"] = function() {
var logger = require('../').console({level:Number.MAX_VALUE,
- transpot : function(data) {
+ transport : function(data) {
return data;
}
});

0 comments on commit 8b3dfdb

Please sign in to comment.
Something went wrong with that request. Please try again.