Comparing version 1.1.2 to 1.1.3
@@ -46,2 +46,12 @@ "use strict"; | ||
}; | ||
class StackTrace { | ||
constructor(context) { | ||
this.stack = ''; | ||
Error.captureStackTrace(this, context); | ||
this.stack = this.stack | ||
.split('\n') | ||
.slice(1) | ||
.join('\n'); | ||
} | ||
} | ||
exports.createLogger = (category, isBrowser) => { | ||
@@ -54,5 +64,9 @@ const colorCat = colorize(category, isBrowser); | ||
const stack = () => { | ||
const stackTrace = { stack: undefined }; | ||
Error.captureStackTrace(stackTrace, stack); | ||
console.log(stackTrace.stack); | ||
const stackTrace = new StackTrace(stack); | ||
if (isBrowser) { | ||
console.log(`%c${stackTrace.stack}`, 'color: #999'); | ||
} | ||
else { | ||
console.log(chalk_1.default.hsl(0, 0, 30)(stackTrace.stack)); | ||
} | ||
}; | ||
@@ -59,0 +73,0 @@ return { stack }; |
@@ -15,3 +15,3 @@ { | ||
}, | ||
"version": "1.1.2" | ||
"version": "1.1.3" | ||
} |
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
5712
138