mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
feat: Add stack trace utility and enhance logging across various modules
This commit is contained in:
5
utils.ts
5
utils.ts
@@ -377,3 +377,8 @@ export function replaceExtname(path: string, ext: string) {
|
||||
}
|
||||
return path.slice(0, path.length - extname(path).length) + ext;
|
||||
}
|
||||
|
||||
export function stackTrace(skip: number = 0) {
|
||||
const err = new Error();
|
||||
return err.stack?.split("\n").slice(2 + skip).join("\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user