Skip to content

Commit a9a3d8a

Browse files
authored
Merge pull request #8 from tenable/feature/better-env-reporting
Updated the connector console to always run 135 cols wide, and to improve debug reporting.
2 parents 9617a25 + 0aaccf6 commit a9a3d8a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tenint/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
from .models.configuration import Configuration, Settings # noqa F401
33
from .connector import Connector # noqa F401
44

5-
__version__ = '0.9.3'
5+
__version__ = '0.9.4'

tenint/connector.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import inspect
99
import json
1010
import logging
11+
import os
1112
import tomllib
1213
from enum import Enum
1314
from pathlib import Path
@@ -63,7 +64,7 @@ def __init__(
6364
credentials: list[type[Credential]] | None = None,
6465
):
6566
self.app = Typer(add_completion=False)
66-
self.console = Console()
67+
self.console = Console(width=135)
6768
self.settings = settings
6869
self.defaults = (
6970
defaults if defaults else settings.model_construct().model_dump()
@@ -224,16 +225,22 @@ def cmd_run(
224225
console=self.console,
225226
rich_tracebacks=True,
226227
omit_repeated_times=False,
228+
tracebacks_show_locals=True if log_level == 'DEBUG' else False,
227229
)
228230
],
229231
)
230232
status_code = 0
231233
resp = None
232234

235+
for k, v in os.environ.items():
236+
logger.debug(f'Environment variable {k}={v}')
233237
# Attempt to run the connector job and handle any errors that may be thrown
234238
# in a graceful way.
235239
try:
236240
config = self.fetch_config(json_data, filename)
241+
logger.debug(
242+
'Running job with configuration {config.model_dump(mode="json")}'
243+
)
237244
resp = self.main(config=config, since=since)
238245
except (ValidationError, ConfigurationError) as _:
239246
logging.error('Invalid configuration presented', exc_info=True)

0 commit comments

Comments
 (0)