File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import {
3131 getDefaultAuthority ,
3232 mapUriDefaultScheme ,
3333} from './resolver' ;
34- import { trace } from './logging' ;
34+ import { trace , isTracerEnabled } from './logging' ;
3535import { SubchannelAddress } from './subchannel-address' ;
3636import { mapProxyName } from './http_proxy' ;
3737import { GrpcUri , parseUri , uriToString } from './uri-parser' ;
@@ -424,15 +424,17 @@ export class InternalChannel {
424424 JSON . stringify ( options , undefined , 2 )
425425 ) ;
426426 const error = new Error ( ) ;
427- trace (
428- LogVerbosity . DEBUG ,
429- 'channel_stacktrace' ,
430- '(' +
431- this . channelzRef . id +
432- ') ' +
433- 'Channel constructed \n' +
434- error . stack ?. substring ( error . stack . indexOf ( '\n' ) + 1 )
435- ) ;
427+ if ( isTracerEnabled ( 'channel_stacktrace' ) ) {
428+ trace (
429+ LogVerbosity . DEBUG ,
430+ 'channel_stacktrace' ,
431+ '(' +
432+ this . channelzRef . id +
433+ ') ' +
434+ 'Channel constructed \n' +
435+ error . stack ?. substring ( error . stack . indexOf ( '\n' ) + 1 )
436+ ) ;
437+ }
436438 this . lastActivityTimestamp = new Date ( ) ;
437439 }
438440
You can’t perform that action at this time.
0 commit comments