Skip to content

Commit

Permalink
Support --debug CLI option to enable debug logging
Browse files Browse the repository at this point in the history
Change-Id: Ic40399ff08e5e2384e1db2458099c0fb65b9fa55
  • Loading branch information
marxarelli committed Jan 19, 2024
1 parent 917c3cf commit 87f2a86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gerritlab/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import shutil
import time
import os
Expand Down Expand Up @@ -313,6 +314,12 @@ def main():
nargs="?",
help="The final branch that commits are intended to be merged into.",
)
parser.add_argument(
"--debug",
action="store_true",
default=False,
help="Show debugging information (subprocesses, HTTP requests, etc)."
)
parser.add_argument(
"--merge",
"-m",
Expand All @@ -336,6 +343,9 @@ def main():
)
args = parser.parse_args()

if args.debug:
logging.basicConfig(level=logging.DEBUG)

repo = Repo(os.getcwd(), search_parent_directories=True)
ensure_commitmsg_hook(repo.git_dir)

Expand Down

0 comments on commit 87f2a86

Please sign in to comment.