Skip to content

Commit 2918ed9

Browse files
committed
fix(docs): update logging
Signed-off-by: Chris Snow <[email protected]>
1 parent 621493b commit 2918ed9

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

docs/source/cli_overview.rst

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ Install the library:
99

1010
.. code-block:: bash
1111
12-
# ensure you have an up-to-date pip
13-
pip3 install -U pip
14-
15-
pip3 install --upgrade git+https://github.com/hpe-container-platform-community/hpecp-client@master
12+
pip3 install --upgrade hpecp
1613
1714
1815
Create a configuration file:
@@ -63,6 +60,40 @@ Typical valid values are `ERROR`, `WARNING`, `INFO`, `DEBUG` - the default value
6360
6461
See https://docs.python.org/3.7/howto/logging.html for much more info on logging.
6562
63+
To log to a file, set the environment variables `HPECP_LOG_CONFIG_FILE`, e.g. `HPECP_LOG_CONFIG_FILE=~/.hpecp_logging.conf`.
64+
Here is an example config file:
65+
66+
.. code-block:: bash
67+
68+
[loggers]
69+
keys=root,HPECP_CLI
70+
71+
[handlers]
72+
keys=fileHandler
73+
74+
[formatters]
75+
keys=simpleFormatter
76+
77+
[logger_root]
78+
level=DEBUG
79+
handlers=fileHandler
80+
81+
[logger_HPECP_CLI]
82+
level=DEBUG
83+
handlers=fileHandler
84+
qualname=HPECP_CLI
85+
86+
[handler_fileHandler]
87+
class=FileHandler
88+
level=DEBUG
89+
formatter=simpleFormatter
90+
args=("/Users/christophersnow/Desktop/hcp-demo-env-aws-terraform/hpecp.log","a")
91+
92+
[formatter_simpleFormatter]
93+
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
94+
datefmt=
95+
96+
6697
6798
CLI Help
6899
--------

docs/source/installation.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ Note that until the API of this library will be unstable and subject to change u
1010

1111
.. code-block:: bash
1212
13-
# ensure you have an up-to-date pip
14-
pip3 install -U pip
15-
16-
pip3 install --upgrade git+https://github.com/hpe-container-platform-community/hpecp-client@master
13+
pip3 install --upgrade hpecp
1714

0 commit comments

Comments
 (0)