Skip to content

Commit c537236

Browse files
committed
fix(debug): more logging control
Signed-off-by: Chris Snow <[email protected]>
1 parent 2bfcf9f commit c537236

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

bin/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import six
3737
from jinja2 import Environment
3838

39+
import hpecp
3940
from hpecp import ContainerPlatformClient
4041
from hpecp.cli.catalog import CatalogProxy
4142
from hpecp.cli.gateway import GatewayProxy
@@ -386,7 +387,10 @@ def bash(self,):
386387

387388
def version():
388389
"""Display version information."""
389-
print(ContainerPlatformClient.version())
390+
print("HPECP Version: " + ContainerPlatformClient.version())
391+
print("HPECP Path: " + hpecp.__file__)
392+
print("Python Version: " + sys.version.replace("\n", ""))
393+
print("Python Path: " + sys.executable)
390394

391395

392396
class CLI(object):

docs/source/cli_overview.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,17 @@ Typical valid values are `ERROR`, `WARNING`, `INFO`, `DEBUG` - the default value
6060
6161
See https://docs.python.org/3.7/howto/logging.html for much more info on logging.
6262
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:
63+
Logging Configuration
64+
---------------------
65+
66+
To change logging configuration, e.g. to log to a file set the environment variable `HPECP_LOG_CONFIG_FILE` and provide a configuration file.
67+
68+
Example: `HPECP_LOG_CONFIG_FILE=~/.hpecp_logging.conf`:
6569
6670
.. code-block:: bash
6771
68-
[loggers]
69-
keys=root,HPECP_CLI
72+
[loggers]
73+
keys=root,HPECP_CLI
7074
7175
[handlers]
7276
keys=consoleHandler,fileHandler
@@ -94,7 +98,7 @@ keys=root,HPECP_CLI
9498
level=DEBUG
9599
class=FileHandler
96100
formatter=fileFormatter
97-
args=("/Users/christophersnow/Desktop/hcp-demo-env-aws-terraform/hpecp.log","a")
101+
args=("/MY/LOG/FILE/LOCATION/hpecp.log","a")
98102
99103
[formatter_consoleFormatter]
100104
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
@@ -104,6 +108,7 @@ keys=root,HPECP_CLI
104108
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
105109
datefmt=
106110
111+
See https://docs.python.org/3.7/howto/logging.html for much more info on logging.
107112
108113
109114
CLI Help

0 commit comments

Comments
 (0)