Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated to 0.3.5

  • Loading branch information...
commit 6ce98970c41872d74e498f7a58efa5bd2572818f 1 parent f773aea
@baryon authored
Showing with 8 additions and 4 deletions.
  1. +4 −0 README.md
  2. +3 −3 lib/console.js
  3. +1 −1  package.json
View
4 README.md
@@ -348,6 +348,10 @@ module.exports = function(conf) {
## History
+### 0.3.5
+
+* fixed bug: can't get method/line number in express
+
### 0.3.4
* use [tinytim package](https://github.com/baryon/node-tinytim)
View
6 lib/console.js
@@ -42,10 +42,10 @@ 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);
- var reg = /at\s+(.*)\s+\((.*):(\d*):(\d*)\)/ig;
- var sp = reg.exec(data.stack[0]);
+ var reg1 = /at\s+(.*)\s+\((.*):(\d*):(\d*)\)/ig, reg2 = /at\s+()(.*):(\d*):(\d*)/ig, s=data.stack[0];
+ var sp = reg1.exec(s) || reg2.exec(s);
if (sp && sp.length === 5) {
- data.method = sp[1];
+ if(sp[1]) data.method = sp[1];
data.path = sp[2];
data.line = sp[3];
data.pos = sp[4];
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.4",
+ "version": "0.3.5",
"author": "LI Long <lilong@gmail.com>",
"dependencies": {
"dateformat": "1.0.2-1.2.3",
Please sign in to comment.
Something went wrong with that request. Please try again.