Skip to content

Commit

Permalink
expose set logging level in cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajunhuang committed Sep 18, 2017
1 parent 19bc288 commit 7408c23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rq/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def info(cli_config, interval, raw, only_queues, only_workers, by_queue, queues,

@main.command()
@click.option('--burst', '-b', is_flag=True, help='Run in burst mode (quit after all work is done)')
@click.option('--logging_level', type=str, default="INFO", help='Set logging level')
@click.option('--name', '-n', help='Specify a different name')
@click.option('--results-ttl', type=int, help='Default results timeout to be used')
@click.option('--worker-ttl', type=int, help='Default worker timeout to be used')
Expand All @@ -180,7 +181,7 @@ def info(cli_config, interval, raw, only_queues, only_workers, by_queue, queues,
@click.option('--pid', help='Write the process ID number to a file at the specified path')
@click.argument('queues', nargs=-1)
@pass_cli_config
def worker(cli_config, burst, name, results_ttl,
def worker(cli_config, burst, logging_level, name, results_ttl,
worker_ttl, verbose, quiet, sentry_dsn, exception_handler,
pid, queues, **options):
"""Starts an RQ worker."""
Expand Down Expand Up @@ -228,7 +229,7 @@ def worker(cli_config, burst, name, results_ttl,
client = Client(sentry_dsn, transport=HTTPTransport)
register_sentry(client, worker)

worker.work(burst=burst)
worker.work(burst=burst, logging_level=logging_level)
except ConnectionError as e:
print(e)
sys.exit(1)
Expand Down

0 comments on commit 7408c23

Please sign in to comment.