Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
updating docs with note on how to interpret replacedRegions property
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Kaufman committed Mar 14, 2016
1 parent 7813d09 commit 9129ee5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/extensionAuthor/messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ Write
.. include:: \..\messages\log\write.json
:code: json

.. NOTE:: The ``pattern`` property should be a JavaScript compatible `Regular Expression <https://en.wikipedia.org/wiki/Regular_expression>`_ representation of log messages that leverage `string interpolation <https://en.wikipedia.org/wiki/String_interpolation>`_. The purpose of this property is allow Glimpse clients to treat interpolated values specially, `as demonstrated on JSFiddle <https://jsfiddle.net/coc2yofo/12/>`_.
.. NOTE:: The ``replacedRegions`` property is used indicate sub-strings in a log messages that leveraged `string interpolation <https://en.wikipedia.org/wiki/String_interpolation>`_.
The purpose of this property is to allow Glimpse clients to treat interpolated values specially, `as demonstrated
on JSFiddle <https://jsfiddle.net/coc2yofo/12/>`_.

Regular Expressions were chosen since they are `nearly universal <https://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines#Language_features>`_ and can represent any interpolation format. (``%s``, ``{0}``, ``{1:d}``, ``{foo}``, ``$(bar)``, etc.)
``replacedRegions`` is a JSON array of objects, where each object has a ``start`` property and an ``end`` property. ``start``
represents the inclusive start of an interpolated region, and ``end`` represents the exclusive end of the interpolated region.
i.e., ``end`` is the first position after the interpolated region.

MongoDB
=======
Expand Down

0 comments on commit 9129ee5

Please sign in to comment.