Skip to content

Commit

Permalink
updated to 0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
baryon committed Apr 23, 2012
1 parent 2d83086 commit 4896dc5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ module.exports = function(conf) {

## History

### 0.4.2

* fixed: debug color from blue to cyan

### 0.4.1

* fixed: default timestamp is ISO UTC format.
Expand Down
17 changes: 10 additions & 7 deletions example/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ logger.info('hello %s %d', 'world', 123, {foo:'bar'});
logger.warn('hello %s %d %j', 'world', 123, {foo:'bar'});
logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object);

eval("logger.log('hello');");

//$ node example/console.js
//2012-03-02T13:42:00.99Z <log> console.js:3 (Object.<anonymous>) hello
//2012-03-02T13:42:01.02Z <trace> console.js:4 (Object.<anonymous>) hello world
//2012-03-02T13:42:01.03Z <debug> console.js:5 (Object.<anonymous>) hello world 123
//2012-03-02T13:42:01.05Z <info> console.js:6 (Object.<anonymous>) hello world 123 { foo: 'bar' }
//2012-03-02T13:42:01.07Z <warn> console.js:7 (Object.<anonymous>) hello world 123 {"foo":"bar"}
//2012-03-02T13:42:01.07Z <error> console.js:8 (Object.<anonymous>) hello world 123 {"foo":"bar"} [ 1, 2, 3, 4 ] function Object() { [native code] }

//$ node console.js
//2012-04-23T01:56:56.296Z <log> console.js:3 (Object.<anonymous>) hello
//2012-04-23T01:56:56.316Z <trace> console.js:4 (Object.<anonymous>) hello world
//2012-04-23T01:56:56.318Z <debug> console.js:5 (Object.<anonymous>) hello world 123
//2012-04-23T01:56:56.320Z <info> console.js:6 (Object.<anonymous>) hello world 123 { foo: 'bar' }
//2012-04-23T01:56:56.320Z <warn> console.js:7 (Object.<anonymous>) hello world 123 {"foo":"bar"}
//2012-04-23T01:56:56.321Z <error> console.js:8 (Object.<anonymous>) hello world 123 {"foo":"bar"} [ 1, 2, 3, 4 ] function Object() { [native code] }
//2012-04-23T01:56:56.323Z <log> console.js:10 (Object.<anonymous> (eval at <anonymous>) hello
4 changes: 2 additions & 2 deletions lib/color_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var colors = require('colors');
module.exports = function(conf) {
return require('./console')({
filters : {
//log : colors.black,
log : colors.black,
trace : colors.magenta,
debug : colors.blue,
debug : colors.cyan,
info : colors.green,
warn : colors.yellow,
error : [ colors.red, colors.bold ]
Expand Down
1 change: 1 addition & 0 deletions lib/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = (function() {
// get call stack, and analyze it, get all file,method and line number
data.stack = (new Error()).stack.split('\n').slice(3);

//Stack trace format : http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
var s=data.stack[0]
, _reg1 = /at\s+(.*)\s+\((.*):(\d*):(\d*)\)/ig, _reg2 = /at\s+()(.*):(\d*):(\d*)/ig
, sp = _reg1.exec(s) || _reg2.exec(s);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.1",
"version": "0.4.2",
"author": "LI Long <lilong@gmail.com>",
"dependencies": {
"dateformat": "1.0.2-1.2.3",
Expand Down

0 comments on commit 4896dc5

Please sign in to comment.