Inspect Connection (#784)

Handles `console.log` and `utils.inspect` invocations for a better debugging experience.

`agent` and `ssl` are hidden since they made the logs very hard to read.
The user can still access them with `instance.agent` and `instance.ssl`.
This commit is contained in:
Tomas Della Vedova
2019-03-19 09:50:36 +01:00
committed by delvedor
parent 8b3eca2611
commit 070dd239bb
3 changed files with 66 additions and 3 deletions

2
lib/Connection.d.ts vendored
View File

@ -20,6 +20,7 @@
/// <reference types="node" />
import { URL } from 'url';
import { inspect, InspectOptions } from 'util';
import * as http from 'http';
import { SecureContextOptions } from 'tls';
@ -73,6 +74,7 @@ export default class Connection {
setRole(role: string, enabled: boolean): Connection;
status: string;
buildRequestObject(params: any): http.ClientRequestArgs;
[inspect.custom](object: any, options: InspectOptions): string;
}
export {};