Removing long path

This commit is contained in:
2017-10-21 12:36:18 +02:00
parent a649e758d5
commit cec4cf158a
4 changed files with 18 additions and 13 deletions

View File

@ -180,17 +180,20 @@ export class Logging {
function _getCallerFile() {
try {
var err = new Error();
var callerfile;
var currentfile;
var caller_file: string;
var current_file: string;
(<any>Error).prepareStackTrace = function (err, stack) { return stack; };
currentfile = (<any>err.stack).shift().getFileName();
current_file = (<any>err.stack).shift().getFileName();
while (err.stack.length) {
callerfile = (<any>err.stack).shift().getFileName();
caller_file = (<any>err.stack).shift().getFileName();
if (currentfile !== callerfile) return callerfile;
if (current_file !== caller_file) {
let array = caller_file.split("/")
return array[array.length - 1];
}
}
} catch (err) { }
return undefined;