Skip to content

Commit

Permalink
Feature: add line number to log to make debug easier (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts authored Mar 10, 2023
2 parents 33176ba + e0856fc commit 47d0c87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qgis_deployment_toolbelt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def main(in_args: list[str] = None):

logging.basicConfig(
level=args.verbosity,
format="%(asctime)s||%(levelname)s||%(module)s||%(message)s",
format="%(asctime)s||%(levelname)s||%(module)s||%(lineno)d||%(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)

Expand Down
6 changes: 6 additions & 0 deletions qgis_deployment_toolbelt/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ def get_qgis_bin_path(self) -> Path:
if getenv("QDT_QGIS_EXE_PATH"):
qdt_qgis_exe_path = ast.literal_eval(getenv("QDT_QGIS_EXE_PATH"))
if isinstance(qdt_qgis_exe_path, str):
logger.debug(
f"'QDT_QGIS_EXE_PATH' is a simple string: {getenv('QDT_QGIS_EXE_PATH')}"
)
return Path(expandvars(expanduser(getenv("QDT_QGIS_EXE_PATH"))))
elif isinstance(qdt_qgis_exe_path, dict):
logger.debug(
f"'QDT_QGIS_EXE_PATH' is a dictionary: {getenv('QDT_QGIS_EXE_PATH')}"
)
for k, v in qdt_qgis_exe_path.items():
if k in self.names_alter + [self.name_python]:
return Path(expandvars(expanduser(v)))
Expand Down

0 comments on commit 47d0c87

Please sign in to comment.