Skip to content

Commit 1653c26

Browse files
committed
Support --debug CLI option to enable debug logging
Change-Id: Ic40399ff08e5e2384e1db2458099c0fb65b9fa55
1 parent 917c3cf commit 1653c26

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gerritlab/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import shutil
23
import time
34
import os
@@ -313,6 +314,12 @@ def main():
313314
nargs="?",
314315
help="The final branch that commits are intended to be merged into.",
315316
)
317+
parser.add_argument(
318+
"--debug",
319+
action="store_true",
320+
default=False,
321+
help="Show debugging information (subprocesses, HTTP requests, etc).",
322+
)
316323
parser.add_argument(
317324
"--merge",
318325
"-m",
@@ -336,6 +343,9 @@ def main():
336343
)
337344
args = parser.parse_args()
338345

346+
if args.debug:
347+
logging.basicConfig(level=logging.DEBUG)
348+
339349
repo = Repo(os.getcwd(), search_parent_directories=True)
340350
ensure_commitmsg_hook(repo.git_dir)
341351

0 commit comments

Comments
 (0)