Skip to content

Commit

Permalink
pypyr.steps.debug #95
Browse files Browse the repository at this point in the history
  • Loading branch information
yaythomas committed Dec 30, 2018
1 parent 61d6379 commit aca1f31
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ Built-in steps
| | expressions with {token} substitutions. | |
| | | |
+-------------------------------+-------------------------------------------------+------------------------------+
| `pypyr.steps.debug`_ | Pretty print pypyr context to output. | debug (dict) |
+-------------------------------+-------------------------------------------------+------------------------------+
| `pypyr.steps.default`_ | Set default values in context. Only set values | defaults (dict) |
| | if they do not exist already. | |
+-------------------------------+-------------------------------------------------+------------------------------+
Expand Down Expand Up @@ -857,6 +859,40 @@ This will result in context like this:
See a worked example `for contextsetf here
<https://github.com/pypyr/pypyr-example/tree/master/pipelines/contextset.yaml>`__.

pypyr.steps.debug
^^^^^^^^^^^^^^^^^
Pretty print the context to output.

Print the pypyr context to the pypyr output. This is likely to be the console.
This may assist in debugging when trying to see what values are what.

Obviously, be aware that if you have sensitive values like passwords in your
context you probably want to be careful about this. No duh.

All inputs are optional. This means you can run debug in a pipeline as a
simple step just with

.. code-block:: yaml
steps:
- pypyr.steps.debug
In this case it will dump the entire context as is without applying formatting.

Debug supports the following optional inputs:

.. code-block:: yaml
debug: # optional
keys: keytodump # optional. str for a single key name to print.
# or a list of key names to print ['key1', 'key2'].
# if not specified, print entire context.
format: False # optional. Boolean, defaults False.
# Applies formatting expressions to output.
See some worked examples of `use debug to pretty print context here
<https://github.com/pypyr/pypyr-example/blob/master/pipelines/debug.yaml>`__.

pypyr.steps.default
^^^^^^^^^^^^^^^^^^^
Sets values in context if they do not exist already. Does not overwrite
Expand Down

0 comments on commit aca1f31

Please sign in to comment.