syntex-logger
Advanced tools
Comparing version 1.0.8-b5 to 1.0.8-b6
37
main.js
@@ -156,20 +156,29 @@ let LanguageSwitcher = require('./language_manager'); | ||
{ | ||
var reference; | ||
var reference, stack; | ||
if(error.stack != null && error.stack.includes('at ')) | ||
if(error.stack != null) | ||
{ | ||
var p = error.stack.split('at ')[1]; | ||
var lines = error.stack.split('\n'); | ||
if(p.includes('\n')) | ||
{ | ||
p = p.split('\n')[0]; | ||
} | ||
lines.splice(0, 1); | ||
var s = (p.match(/\//g) || []).length; | ||
stack = lines.join('\n'); | ||
if(s > 0 && p.includes(':')) | ||
if(error.stack.includes('at ')) | ||
{ | ||
p = p.split('/')[s]; | ||
var p = error.stack.split('at ')[1]; | ||
reference = { script : p.split(':')[0], row : p.split(':')[1] }; | ||
if(p.includes('\n')) | ||
{ | ||
p = p.split('\n')[0]; | ||
} | ||
var s = (p.match(/\//g) || []).length; | ||
if(s > 0 && p.includes(':')) | ||
{ | ||
p = p.split('/')[s]; | ||
reference = { script : p.split(':')[0], row : p.split(':')[1] }; | ||
} | ||
} | ||
@@ -180,10 +189,8 @@ } | ||
{ | ||
this.log('error', 'bridge', 'Bridge', '%error[0]%: ' + error.message + ' ( [' + reference.script + '] %error[1]% [' + reference.row + '] )'); | ||
this.log('error', 'bridge', 'Bridge', '%error[0]%: ' + error.message + ' ( [' + reference.script + '] %error[1]% [' + reference.row + '] )', stack); | ||
} | ||
else | ||
{ | ||
this.log('error', 'bridge', 'Bridge', '%error[0]%: ' + error.message); | ||
this.log('error', 'bridge', 'Bridge', '%error[0]%: ' + error.message, stack); | ||
} | ||
console.log(error); | ||
} | ||
@@ -190,0 +197,0 @@ |
{ | ||
"name": "syntex-logger", | ||
"version": "1.0.8-b5", | ||
"version": "1.0.8-b6", | ||
"description": "A Basic Logging System", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24690
532