docs: fix syntax highlighting of code blocks
And various other cleanups
Change-Id: If945f5407036e73db980cafd2185359a488a0ff1
diff --git a/docs/manpages/ndn-client.conf.rst b/docs/manpages/ndn-client.conf.rst
index 5908972..a2bd6fc 100644
--- a/docs/manpages/ndn-client.conf.rst
+++ b/docs/manpages/ndn-client.conf.rst
@@ -6,13 +6,14 @@
The configuration file ``client.conf`` is looked up in several directories in the following order:
- ``$HOME/.ndn``: user-specific settings
-- ``@SYSCONFDIR@/ndn`` (``/usr/local/etc/ndn``, ``/opt/local/etc/ndn``, or other, depending how the
- library is configured): system-wide settings
+- ``SYSCONFDIR/ndn``: system-wide settings (where ``SYSCONFDIR`` can be ``/usr/local/etc``,
+ ``/opt/local/etc``, or other, depending on how the library is configured)
- ``/etc/ndn``: default system-wide settings
-Here is an example of ``client.conf`` for current ndn-cxx package:
+Here is an example of ``client.conf`` for the current ndn-cxx package:
.. literalinclude:: ../../client.conf.sample
+ :language: ini
NFD
diff --git a/docs/manpages/ndn-log.rst b/docs/manpages/ndn-log.rst
index 40db707..0a88f3e 100644
--- a/docs/manpages/ndn-log.rst
+++ b/docs/manpages/ndn-log.rst
@@ -46,11 +46,13 @@
Setting NDN_LOG requires the following syntax with as many prefixes and
corresponding loglevels as the user desires:
+.. code-block:: sh
+
export NDN_LOG="<prefix1>=<loglevel1>:<prefix2>=<loglevel2>"
-**Examples:**
+*Example:*
-::
+.. code-block:: sh
export NDN_LOG="ndn.*=DEBUG"
export NDN_LOG="ndn.UnixTransport=INFO"
@@ -59,30 +61,40 @@
**Note:**
-Shorter (general) prefixes should be placed before longer (specific) prefixes.
-Otherwise, the specific prefix's loglevel will be overwritten. For example,
-`export NDN_LOG="ndn.UnixTransport=TRACE:ndn.*=ERROR:*=INFO"` sets all modules
-to INFO; it should be written as
-`export NDN_LOG="*=INFO:ndn.*=ERROR:ndn.UnixTransport=TRACE"` for the desired effect.
+The loglevel assignments in ``NDN_LOG`` are processed left-to-right. Thus, shorter
+(more general) prefixes should be listed before longer (more specific) prefixes.
+Otherwise, the loglevel setting of a more specific prefix may be overwritten by a
+more general assignment appearing later in the string. For example:
+
+.. code-block:: sh
+
+ export NDN_LOG="ndn.UnixTransport=TRACE:ndn.*=ERROR:*=INFO"
+
+will set all modules to INFO. To obtain the desired effect, it should instead be
+written as:
+
+.. code-block:: sh
+
+ export NDN_LOG="*=INFO:ndn.*=ERROR:ndn.UnixTransport=TRACE"
**Note:**
Setting the environment variable with sudo requires the application to be run
in the same command.
-::
+.. code-block:: sh
- Correct:
+ # Correct
+ sudo env NDN_LOG=logLevel ./ndn-application
- sudo env NDN_LOG=logLevel ./ndn-application
+ # Also correct
+ sudo -s
+ export NDN_LOG=logLevel
+ ./ndn-application
- sudo -s
- export NDN_LOG=logLevel
- ./ndn-application
+ # Incorrect
+ sudo export NDN_LOG=logLevel
+ sudo ./ndn-application
- Incorrect:
-
- sudo export NDN_LOG=logLevel
- sudo ./ndn-application
-
- NDN_LOG=logLevel sudo ./ndn-application
+ # Incorrect
+ NDN_LOG=logLevel sudo ./ndn-application