membershipworks: Allow setting verbosity in scrape_events
command
This commit is contained in:
parent
31c9a9b13d
commit
521c6cd52a
@ -1,8 +1,18 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from membershipworks.tasks.scrape import scrape_events
|
from membershipworks.tasks.scrape import logger, scrape_events
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, verbosity: int, **options):
|
||||||
|
verbosity_levels = {
|
||||||
|
0: logging.ERROR,
|
||||||
|
1: logging.WARNING,
|
||||||
|
2: logging.INFO,
|
||||||
|
3: logging.DEBUG,
|
||||||
|
}
|
||||||
|
logger.setLevel(verbosity_levels.get(verbosity, logging.WARNING))
|
||||||
|
|
||||||
scrape_events()
|
scrape_events()
|
||||||
|
Loading…
Reference in New Issue
Block a user