Merge pull request #1387 from badsyntax/grpc-js--better-trace-logs

grpc-js: fix target in tracing logs
This commit is contained in:
Michael Lumish 2020-04-23 14:55:49 -07:00 committed by GitHub
commit 5d5468673f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -406,7 +406,7 @@ export class ChannelImplementation implements Channel {
trace(
LogVerbosity.DEBUG,
'connectivity_state',
this.target +
uriToString(this.target) +
' ' +
ConnectivityState[this.connectivityState] +
' -> ' +
@ -496,7 +496,7 @@ export class ChannelImplementation implements Channel {
trace(
LogVerbosity.DEBUG,
'channel',
this.target +
uriToString(this.target) +
' createCall [' +
callNumber +
'] method="' +

View File

@ -136,7 +136,7 @@ export function mapProxyName(
const serverHost = hostPort.host;
for (const host of getNoProxyHostList()) {
if (host === serverHost) {
trace('Not using proxy for target in no_proxy list: ' + target);
trace('Not using proxy for target in no_proxy list: ' + uriToString(target));
return noProxyResult;
}
}

View File

@ -111,7 +111,7 @@ class DnsResolver implements Resolver {
this.defaultResolutionError = {
code: Status.UNAVAILABLE,
details: `Name resolution failed for target ${this.target}`,
details: `Name resolution failed for target ${uriToString(this.target)}`,
metadata: new Metadata(),
};
}
@ -122,7 +122,7 @@ class DnsResolver implements Resolver {
*/
private startResolution() {
if (this.ipResult !== null) {
trace('Returning IP address for target ' + this.target);
trace('Returning IP address for target ' + uriToString(this.target));
setImmediate(() => {
this.listener.onSuccessfulResolution(this.ipResult!, null, null);
});
@ -132,7 +132,7 @@ class DnsResolver implements Resolver {
setImmediate(() => {
this.listener.onError({
code: Status.UNAVAILABLE,
details: `Failed to parse DNS address ${this.target}`,
details: `Failed to parse DNS address ${uriToString(this.target)}`,
metadata: new Metadata(),
});
});
@ -171,7 +171,7 @@ class DnsResolver implements Resolver {
']';
trace(
'Resolved addresses for target ' +
this.target +
uriToString(this.target) +
': ' +
allAddressesString
);
@ -192,7 +192,7 @@ class DnsResolver implements Resolver {
(err) => {
trace(
'Resolution error for target ' +
this.target +
uriToString(this.target) +
': ' +
(err as Error).message
);
@ -254,7 +254,7 @@ class DnsResolver implements Resolver {
}
updateResolution() {
trace('Resolution update requested for target ' + this.target);
trace('Resolution update requested for target ' + uriToString(this.target));
if (this.pendingLookupPromise === null) {
this.startResolution();
}

View File

@ -35,7 +35,7 @@ import { Metadata } from './metadata';
import * as logging from './logging';
import { LogVerbosity } from './constants';
import { SubchannelAddress } from './subchannel';
import { GrpcUri } from './uri-parser';
import { GrpcUri, uriToString } from './uri-parser';
const TRACER_NAME = 'resolving_load_balancer';
@ -353,7 +353,7 @@ export class ResolvingLoadBalancer implements LoadBalancer {
private updateState(connectivitystate: ConnectivityState, picker: Picker) {
trace(
this.target +
uriToString(this.target) +
' ' +
ConnectivityState[this.currentState] +
' -> ' +