Closed rudemex closed 4 years ago
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.
Describe the solution you'd like Solution in signale.js
get filename() { const _ = Error.prepareStackTrace; Error.prepareStackTrace = (error, stack) => stack; const {stack} = new Error(); Error.prepareStackTrace = _; const callers = stack.map(x => x.getFileName()); const callersAndLines = stack.map( x => ({"filename": x.getFileName(), "line": x.getLineNumber()})); const firstExternalFilePath = callers.find(x => { return x !== callers[0]; }); const filenameAndLine = callersAndLines.find( x => { return x.filename !== callers[0]; }); return firstExternalFilePath ? `${path.basename(filenameAndLine.filename)} - Line: ${filenameAndLine.line}` : 'anonymous'; }
Additional context Add any other context or screenshots about the feature request here.
Implemented in => https://github.com/klaussinani/signale/pull/112
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.
Describe the solution you'd like Solution in signale.js
Additional context Add any other context or screenshots about the feature request here.