Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

landing_worker: set debug level according to verbosity CLI option (bug 1935044) #160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lando/main/management/commands/start_landing_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ def handle_git(self, worker: Worker):

def handle(self, name: str, **options):
"""Select a landing worker based on provided argument and start it up."""

if v := options.get("verbosity"):
verbosity_map = {
0: logging.ERROR,
1: logging.WARNING,
2: logging.INFO,
3: logging.DEBUG,
}
logging.basicConfig(level=verbosity_map[v])

handlers = {
Repo.HG: self.handle_hg,
Repo.GIT: self.handle_git,
Expand Down