Class InspectorViewerContext


  • public class InspectorViewerContext
    extends ValueListViewerContext
    Represents the inspector viewer in the Console which displays key/value pairs in an object inspector control.

    The inspector viewer in the Console interprets the data of a Log Entry as a key/value list with group support like object inspectors from popular IDEs. This class takes care of the necessary formatting and escaping required by the corresponding inspector viewer in the Console.

    You can use the InspectorViewerContext class for creating custom log methods around logCustomContext for sending custom data organized as grouped key/value pairs.

    Thread Safety: This class is not guaranteed to be thread safe.

    • Constructor Detail

      • InspectorViewerContext

        public InspectorViewerContext()
        Creates and initializes an InspectorViewerContext instance.
    • Method Detail

      • startGroup

        public void startGroup​(String group)
        Starts a new group.
        Parameters:
        group - The name of the group to use.
      • escapeItem

        public String escapeItem​(String item)
        Overridden. Escapes a key or a value. This method ensures that the escaped key or value does not contain any newline characters, such as the carriage return or linefeed characters. Furthermore, it escapes the '\', '=', '[' and ']' characters.
        Overrides:
        escapeItem in class ValueListViewerContext
        Parameters:
        item - The key or value to escape.
        Returns:
        The escaped key or value.