Class TracingMessageConsumer

  • All Implemented Interfaces:
    MessageConsumer

    public class TracingMessageConsumer
    extends java.lang.Object
    implements MessageConsumer
    A MessageConsumer that outputs logs in a format that can be parsed by the LSP Inspector. https://microsoft.github.io/language-server-protocol/inspector/
    • Constructor Detail

      • TracingMessageConsumer

        public TracingMessageConsumer​(MessageConsumer messageConsumer,
                                      java.util.Map<java.lang.String,​TracingMessageConsumer.RequestMetadata> sentRequests,
                                      java.util.Map<java.lang.String,​TracingMessageConsumer.RequestMetadata> receivedRequests,
                                      java.io.PrintWriter printWriter,
                                      java.time.Clock clock)
        Parameters:
        messageConsumer - The MessageConsumer to wrap.
        sentRequests - A map that keeps track of pending sent request data.
        receivedRequests - A map that keeps track of pending received request data.
        printWriter - Where to write the log to.
        clock - The clock that is used to calculate timestamps and durations.
      • TracingMessageConsumer

        public TracingMessageConsumer​(MessageConsumer messageConsumer,
                                      java.util.Map<java.lang.String,​TracingMessageConsumer.RequestMetadata> sentRequests,
                                      java.util.Map<java.lang.String,​TracingMessageConsumer.RequestMetadata> receivedRequests,
                                      java.io.PrintWriter printWriter,
                                      java.time.Clock clock,
                                      java.util.Locale locale)
        Parameters:
        messageConsumer - The MessageConsumer to wrap.
        sentRequests - A map that keeps track of pending sent request data.
        receivedRequests - A map that keeps track of pending received request data.
        printWriter - Where to write the log to.
        clock - The clock that is used to calculate timestamps and durations.
        locale - THe Locale to format the timestamps and durations, or null to use default locale.