Skip to content

Commit 2477d2e

Browse files
committed
fix: detect DEBUG flag on client creation
This enables dynamic debug logging through the CLI without adding any additional flags re twilio-labs/serverless-toolkit#50
1 parent b9d4fb7 commit 2477d2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/client.ts

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export class TwilioServerlessApiClient extends events.EventEmitter {
7676
private client: GotClient;
7777

7878
constructor(config: ClientConfig) {
79+
debug.enable(process.env.DEBUG || '');
7980
super();
8081
this.config = config;
8182
this.client = createGotClient(config);
@@ -86,6 +87,7 @@ export class TwilioServerlessApiClient extends events.EventEmitter {
8687
* @returns {GotClient} A client instance with set-up credentials
8788
*/
8889
getClient(): GotClient {
90+
debug.enable(process.env.DEBUG || '');
8991
return this.client;
9092
}
9193

0 commit comments

Comments
 (0)