Skip to content

Commit 4a0c04b

Browse files
authored
fix(debugger): fixes debugger redaction in plugin-serverless (#187)
Fixes #185. When using the twilio-run debugger within the serverless plugin, redaction wasn't working. I thought this might be because the debug module was being overwritten. Looking at where the formatters are added, the resultant debug object was never exported and used. Exporting this debugger and explicitly using it brought the formatter back in the plugin.
1 parent 937b678 commit 4a0c04b

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

packages/twilio-run/src/cli.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as NewCommand from './commands/new';
66
import * as StartCommand from './commands/start';
77
import * as ListTemplatesCommand from './commands/list-templates';
88
import * as LogsCommand from './commands/logs';
9-
import './utils/debug';
109

1110
export async function run(rawArgs: string[]) {
1211
yargs

packages/twilio-run/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
import './utils/debug';
2-
31
export { functionToRoute as handlerToExpressRoute } from './runtime/route';
42
export { runServer as runDevServer } from './runtime/server';

packages/twilio-run/src/utils/debug.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,5 @@ debug.formatters.r = function redactedFormatterSameline(v: any): string {
7777
}
7878
return debug.formatters.o.bind(debug)(v);
7979
};
80+
81+
export default debug;

packages/twilio-run/src/utils/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ClientApiError } from '@twilio-labs/serverless-api/dist/utils/error';
2-
import debug from 'debug';
2+
import debug from './debug';
33
import ora from 'ora';
44
import { Writable } from 'stream';
55
import terminalLink from 'terminal-link';

0 commit comments

Comments
 (0)