UNPKG

1.66 kBTypeScriptView Raw
1import * as debug from "debug";
2/**
3 * Faast.js loggers.
4 * @remarks
5 * Unless otherwise specified, each log is disabled by default unless the value
6 * of the DEBUG environment variable is set to the corresponding value. For
7 * example:
8 *
9 * ```
10 * $ DEBUG=faast:info,faast:provider <cmd>
11 * $ DEBUG=faast:* <cmd>
12 * ```
13 *
14 * Logs can also be enabled or disabled programmatically:
15 * ```typescript
16 * import { log } from "faastjs"
17 * log.info.enabled = true;
18 * log.provider.enabled = true;
19 * ```
20 *
21 * Each log outputs specific information:
22 *
23 * `info` - General informational logging.
24 *
25 * `minimal` - Outputs only basic information like the function name created in
26 * the cloud.
27 *
28 * `warn` - Warnings. Enabled by default.
29 *
30 * `gc` - Garbage collection verbose logging.
31 *
32 * `leaks` - Memory leak detector warnings for the cloud function. Enabled by
33 * default.
34 *
35 * `calls` - Verbose logging of each faast.js enabled function invocation.
36 *
37 * `webpack` - Verbose logging from webpack and packaging details.
38 *
39 * `provider` - Verbose logging of each interaction between faast.js runtime and
40 * the provider-specific implementation.
41 *
42 * `awssdk` - Verbose logging of AWS SDK. This can be useful for identifying
43 * which API calls are failing, retrying, or encountering rate limits.
44 *
45 * @public
46 */
47export declare const log: {
48 info: debug.Debugger;
49 minimal: debug.Debugger;
50 warn: debug.Debugger;
51 gc: debug.Debugger;
52 leaks: debug.Debugger;
53 calls: debug.Debugger;
54 webpack: debug.Debugger;
55 provider: debug.Debugger;
56 awssdk: debug.Debugger;
57};
58export declare function inspectProvider(o: object): string;