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:
13
src/index.ts
13
src/index.ts
@ -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) {
|
||||
|
Reference in New Issue
Block a user