UNPKG

966 BTypeScriptView Raw
1/**
2 * Captures the current process' stack trace.
3 *
4 * Stack traces are often invaluable tools to help diagnose problems, however
5 * their capture is a rather expensive operation, and the stack traces can be
6 * large. Consequently, users are stronly advised to condition capturing stack
7 * traces to specific user opt-in.
8 *
9 * Stack traces will only be captured if the `CDK_DEBUG` environment variable
10 * is set to `'true'` or `1`.
11 *
12 * @param below an optional function starting from which stack frames will be
13 * ignored. Defaults to the `captureStackTrace` function itself.
14 * @param limit and optional upper bound to the number of stack frames to be
15 * captured. If not provided, this defaults to
16 * `Number.MAX_SAFE_INTEGER`, effectively meaning "no limit".
17 *
18 * @returns the captured stack trace, as an array of stack frames.
19 */
20export declare function captureStackTrace(below?: Function, limit?: number): string[];