Skip to content

Commit

Permalink
docs: Update links
Browse files Browse the repository at this point in the history
Update various links after moving `shell-logger` out onto GitHub.
  • Loading branch information
jmgate committed Feb 28, 2024
1 parent b6de407 commit 89d88fa
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 45 deletions.
1 change: 0 additions & 1 deletion doc/source/abstract_method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ AbstractMethod
==============

.. autoexception:: shell_logger.abstract_method.AbstractMethod
:noindex:
37 changes: 35 additions & 2 deletions doc/source/html_utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,38 @@ HTML Utilities
The following are a number of utility functions used to generate the HTML log
file produced by :class:`ShellLogger`.

.. automodule:: shell_logger.html_utilities
:noindex:
.. autofunction:: shell_logger.html_utilities.append_html
.. autofunction:: shell_logger.html_utilities.child_logger_card
.. autofunction:: shell_logger.html_utilities.child_logger_card_html
.. autofunction:: shell_logger.html_utilities.closing_html_text
.. autofunction:: shell_logger.html_utilities.command_card
.. autofunction:: shell_logger.html_utilities.command_card_html
.. autofunction:: shell_logger.html_utilities.command_detail
.. autofunction:: shell_logger.html_utilities.command_detail_list
.. autofunction:: shell_logger.html_utilities.diagnostics_card
.. autofunction:: shell_logger.html_utilities.disk_time_series_plot
.. autofunction:: shell_logger.html_utilities.embed_html
.. autofunction:: shell_logger.html_utilities.embed_script
.. autofunction:: shell_logger.html_utilities.embed_style
.. autofunction:: shell_logger.html_utilities.fixed_width
.. autofunction:: shell_logger.html_utilities.flatten
.. autofunction:: shell_logger.html_utilities.get_human_time
.. autofunction:: shell_logger.html_utilities.html_encode
.. autofunction:: shell_logger.html_utilities.html_header
.. autofunction:: shell_logger.html_utilities.html_message_card
.. autofunction:: shell_logger.html_utilities.load_template
.. autofunction:: shell_logger.html_utilities.message_card
.. autofunction:: shell_logger.html_utilities.nested_simplenamespace_to_dict
.. autofunction:: shell_logger.html_utilities.opening_html_text
.. autofunction:: shell_logger.html_utilities.output_block
.. autofunction:: shell_logger.html_utilities.output_block_card
.. autofunction:: shell_logger.html_utilities.output_block_html
.. autofunction:: shell_logger.html_utilities.output_line_html
.. autofunction:: shell_logger.html_utilities.parent_logger_card_html
.. autofunction:: shell_logger.html_utilities.sgr_24bit_color_to_html
.. autofunction:: shell_logger.html_utilities.sgr_4bit_color_and_style_to_html
.. autofunction:: shell_logger.html_utilities.sgr_8bit_color_to_html
.. autofunction:: shell_logger.html_utilities.sgr_to_html
.. autofunction:: shell_logger.html_utilities.split_template
.. autofunction:: shell_logger.html_utilities.stat_chart_card
.. autofunction:: shell_logger.html_utilities.time_series_plot
52 changes: 24 additions & 28 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ while logging various metadata, statistics, and trace information. Any time
you're tempted to write your own wrapper around things like
:class:`subprocess.Popen` or :func:`subprocess.run`, consider using
:func:`ShellLogger.log` instead. If you're familiar with `the Unix script
command <https://man7.org/linux/man-pages/man1/script.1.html>`_, this is
similar in principle, but with substantially more functionality. If you're
familiar with `Python's logging module
<https://docs.python.org/3/library/logging.html>`_, the motivation is similar,
but this intends to capture what's happening *in the shell* rather than in
Python itself.
command`_, this is similar in principle, but with substantially more
functionality. If you're familiar with `Python's logging module`_, the
motivation is similar, but this intends to capture what's happening *in the
shell* rather than in Python itself.

The following talk from the `US-RSE Virtual Workshop 2021
<https://us-rse.org/virtual-workshop-2021/>`_ illustrates the module's
functionality.
.. _the Unix script command: https://man7.org/linux/man-pages/man1/script.1.html
.. _Python's logging module: https://docs.python.org/3/library/logging.html

The following talk from the `US-RSE Virtual Workshop 2021`_ illustrates the
module's functionality.

.. _US-RSE Virtual Workshop 2021: https://us-rse.org/virtual-workshop-2021/

.. raw:: html

Expand All @@ -53,11 +55,12 @@ functionality.
Where to Get shell-logger
-------------------------

The source repository for this module can be found `here
<https://internal.gitlab.server/ShellLogger/ShellLogger>`_. See the project's
`README.md
<https://internal.gitlab.server/ShellLogger/ShellLogger/-/blob/master/README.md>`_
for details on how to clone, install, and otherwise interact with the project.
The source repository for this module can be found `on GitHub`_. See the
project's `README`_ for details on how to clone, install, and otherwise
interact with the project.

.. _on GitHub: https://github.com/sandialabs/shell-logger
.. _README: https://github.com/sandialabs/shell-logger/blob/master/README.md

Using shell-logger
------------------
Expand Down Expand Up @@ -105,17 +108,16 @@ the following:
.. literalinclude:: ../../example/hello_world_html.py
:language: python
:linenos:
:lines: 11-
:caption: ``example/hello_world_html.py``

Running the script yields

.. code-block::
This example demonstrates logging information solely to the HTML log file.
Open /Users/jmgate/workspace/shell-logger/example/log_hello_world_html/2021-09-22_14.56.42.558599_szt68acx/Hello_ShellLogger.html to view the log.
Open <path-to-example-dir>/log_hello_world_html/<timestamp>_<unique-str>/Hello_ShellLogger.html to view the log.
You can view the generated HTML log file `here
<http://shelllogger.internal.gitlab.pages/shell-logger/example/Hello_World_HTML.html>`__.
When you open that file, you'll see something like

.. image:: images/html_log.png
Expand Down Expand Up @@ -175,12 +177,10 @@ highlighted lines below.
.. literalinclude:: ../../example/hello_world_html_and_console.py
:language: python
:linenos:
:emphasize-lines: 11, 13
:lines: 11-
:emphasize-lines: 15-16, 22-23
:caption: ``example/hello_world_html_and_console.py``

You can view the generated HTML log file `here
<http://shelllogger.internal.gitlab.pages/shell-logger/example/Hello_World_HTML_and_Console.html>`__.

Example 3: Collecting Statistics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -191,12 +191,10 @@ and **Example 1** are the highlighted lines below.
.. literalinclude:: ../../example/hello_world_html_with_stats.py
:language: python
:linenos:
:emphasize-lines: 12, 14
:lines: 11-
:emphasize-lines: 16, 22
:caption: ``example/hello_world_html_with_stats.py``

You can view the generated HTML log file `here
<http://shelllogger.internal.gitlab.pages/shell-logger/example/Hello_World_HTML_with_Stats.html>`__.

Example 4: Building a Code
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -215,11 +213,9 @@ The equivalent Python script using ``shell-logger`` is the following:
.. literalinclude:: ../../example/build_flex.py
:language: python
:linenos:
:lines: 11-
:caption: ``example/build_flex.py``

You can view the generated HTML log file `here
<http://shelllogger.internal.gitlab.pages/shell-logger/example/Build_Flex.html>`__.

More Details
------------

Expand Down
3 changes: 1 addition & 2 deletions doc/source/shell.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Shell
=====

.. automodule:: shell_logger.shell
:noindex:
.. autoclass:: shell_logger.shell.Shell
3 changes: 0 additions & 3 deletions doc/source/shell_logger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ ShellLogger
===========

.. autoclass:: shell_logger.ShellLogger
:noindex:

JSON Serialization
------------------

.. autoclass:: shell_logger.ShellLoggerDecoder
:noindex:

.. todo::

Figure out why the documentation below is pulling in the docstring for the
base class as well.

.. autoclass:: shell_logger.ShellLoggerEncoder
:noindex:
5 changes: 0 additions & 5 deletions doc/source/stats_collector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@ StatsCollector
==============

.. autoclass:: shell_logger.stats_collector.StatsCollector
:noindex:

.. automethod:: shell_logger.stats_collector::stats_collectors
:noindex:

DiskStatsCollector
------------------

.. autoclass:: shell_logger.stats_collector.DiskStatsCollector
:noindex:

CPUStatsCollector
-----------------

.. autoclass:: shell_logger.stats_collector.CPUStatsCollector
:noindex:

MemoryStatsCollector
--------------------

.. autoclass:: shell_logger.stats_collector.MemoryStatsCollector
:noindex:
4 changes: 0 additions & 4 deletions doc/source/trace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ Trace
=====

.. autoclass:: shell_logger.trace.Trace
:noindex:

.. automethod:: shell_logger.trace::trace_collector
:noindex:

STrace
------

.. autoclass:: shell_logger.trace.STrace
:noindex:

LTrace
------

.. autoclass:: shell_logger.trace.LTrace
:noindex:

0 comments on commit 89d88fa

Please sign in to comment.