nlogger icon indicating copy to clipboard operation
nlogger copied to clipboard

Line number bug when used on node.js for Windows

Open haroldo-ok opened this issue 12 years ago • 2 comments

Hello,

I've just corrected a bug on the line number routine, when running on windows: the drive letter got in the way, and the routine returned the file path instead of the line number. I got around it by using a regex to extract the line number. Haven't tested it on Linux, but should work okay, too.

haroldo-ok avatar Feb 26 '12 14:02 haroldo-ok

can you please send how does e.stack looks on windows? I want to avoid try-catch block because they are slow.

igo avatar Mar 18 '12 09:03 igo

Of course! Here you go:

Error: This is an stack trace test at Object. (C:\Users\Haroldo\test.js:1:69) at Module._compile (module.js:441:26) at Object..js (module.js:459:10) at Module.load (module.js:348:31) at Function._load (module.js:308:12) at Array.0 (module.js:479:10) at EventEmitter._tickCallback (node.js:192:40)

As you can see, the great villain here is the drive letter, whose following colon confuses the routine that would pick the line number.

Em 18/03/2012 06:33, Igor Urminček escreveu:

can you please send how does e.stack looks on windows? I want to avoid try-catch block because they are slow.


Reply to this email directly or view it on GitHub: https://github.com/igo/nlogger/pull/10#issuecomment-4560128

haroldo-ok avatar Mar 18 '12 09:03 haroldo-ok