1
0
mirror of https://git.hibas.dev/OpenServer/NodeLogging.git synced 2025-07-01 12:41:11 +00:00

Adding underscore and minus to stack parser

This commit is contained in:
Fabian Stamm
2018-09-20 18:30:21 +02:00
parent 7d5404a370
commit 3f035ad1b9
7 changed files with 35 additions and 17 deletions

View File

@ -38,11 +38,20 @@ const OriginalErrorStackFunction = (<any>Error.prototype).prepareStackTrace
export interface LoggingBaseOptions {
/**
* Name will be prefixed on Console output
* Name will be prefixed on Console output and added to logfiles, if not specified here
*/
name: string,
/**
* Filename/path of the logfile. Skip if generated with name
*/
logfile: string;
/**
* Filename/path of the logfile. Skip if generated with name
*/
errorfile: string;
/**
* Prints output to console
*/
console_out: boolean;
}
@ -392,7 +401,7 @@ function getCallerFromExisting(err: Error): { file: string, line: number } {
lines.shift();// removing first line
while (lines.length > 0) {
let line = lines.shift();
let matches = line.match(/[a-zA-Z]+[.][a-zA-Z]+[:][0-9]+/g)
let matches = line.match(/[a-zA-Z_-]+[.][a-zA-Z_-]+[:][0-9]+/g)
if (matches && matches.length > 0) {
let [f, line] = matches[0].split(":")
if (f != current) {