mirror of https://github.com/grpc/grpc-node.git
Improve Listener resource log formatting
This commit is contained in:
parent
506748b8a4
commit
a02622572a
|
@ -250,7 +250,7 @@ class AdsResponseParser {
|
|||
if (!decodeResult.value) {
|
||||
return;
|
||||
}
|
||||
this.adsCallState.client.trace('Parsed resource of type ' + this.result.type.getTypeUrl() + ': ' + JSON.stringify(decodeResult.value, undefined, 2));
|
||||
this.adsCallState.client.trace('Parsed resource of type ' + this.result.type.getTypeUrl() + ': ' + JSON.stringify(decodeResult.value, (key, value) => (value && value.type === 'Buffer' && Array.isArray(value.data)) ? (value.data as Number[]).map(n => n.toString(16)).join('') : value, 2));
|
||||
this.result.haveValidResources = true;
|
||||
if (this.result.type.resourcesEqual(resourceState.cachedResource, decodeResult.value)) {
|
||||
return;
|
||||
|
|
|
@ -106,7 +106,7 @@ export class ListenerResourceType extends XdsResourceType {
|
|||
);
|
||||
}
|
||||
const message = decodeSingleResource(LDS_TYPE_URL, resource.value);
|
||||
trace('Decoded raw resource of type ' + LDS_TYPE_URL + ': ' + JSON.stringify(message, undefined, 2));
|
||||
trace('Decoded raw resource of type ' + LDS_TYPE_URL + ': ' + JSON.stringify(message, (key, value) => (value && value.type === 'Buffer' && Array.isArray(value.data)) ? (value.data as Number[]).map(n => n.toString(16)).join('') : value, 2));
|
||||
const validatedMessage = this.validateResource(message);
|
||||
if (validatedMessage) {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue