Class LoggingInterceptor

  • All Implemented Interfaces:
    io.grpc.ClientInterceptor

    public class LoggingInterceptor
    extends java.lang.Object
    implements io.grpc.ClientInterceptor
    An interceptor which logs all RPCs made on a Channel.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static io.grpc.Metadata.Key<java.lang.String> REQUEST_ID_HEADER_KEY  
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggingInterceptor​(RequestLogger requestLogger, com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> headers, java.lang.String endpoint)
      Creates with the RequestLogger sink, the constant header data, and the API endpoint.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <ReqT,​RespT>
      io.grpc.ClientCall<ReqT,​RespT>
      interceptCall​(io.grpc.MethodDescriptor<ReqT,​RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next)
      Logs the Google Ads API fields required for debugging.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REQUEST_ID_HEADER_KEY

        public static final io.grpc.Metadata.Key<java.lang.String> REQUEST_ID_HEADER_KEY
    • Constructor Detail

      • LoggingInterceptor

        public LoggingInterceptor​(RequestLogger requestLogger,
                                  com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> headers,
                                  java.lang.String endpoint)
        Creates with the RequestLogger sink, the constant header data, and the API endpoint.
    • Method Detail

      • interceptCall

        public <ReqT,​RespT> io.grpc.ClientCall<ReqT,​RespT> interceptCall​(io.grpc.MethodDescriptor<ReqT,​RespT> method,
                                                                                     io.grpc.CallOptions callOptions,
                                                                                     io.grpc.Channel next)
        Logs the Google Ads API fields required for debugging.
        Specified by:
        interceptCall in interface io.grpc.ClientInterceptor