From 444f79eab7f03724be7ec5bfef165229895475e0 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 3 Apr 2019 07:35:43 +0200 Subject: [PATCH] Remove unwanted logger code --- .../management/commands/fetch_stripe_bills.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/hosting/management/commands/fetch_stripe_bills.py b/hosting/management/commands/fetch_stripe_bills.py index cbb09a2e..7219341b 100644 --- a/hosting/management/commands/fetch_stripe_bills.py +++ b/hosting/management/commands/fetch_stripe_bills.py @@ -1,5 +1,4 @@ import logging -import sys from django.core.management.base import BaseCommand @@ -14,32 +13,10 @@ class Command(BaseCommand): help = '''Fetches invoices from Stripe and creates bills for a given customer in the MonthlyHostingBill model''' - def set_logger(self, verbosity): - """ - Set logger level based on verbosity option - """ - handler = logging.StreamHandler(sys.stdout) - formatter = logging.Formatter('%(asctime)s|%(levelname)s|%(module)s| %(message)s') - handler.setFormatter(formatter) - logger.addHandler(handler) - - if verbosity == 0: - self.logger.setLevel(logging.WARN) - elif verbosity == 1: # default - self.logger.setLevel(logging.INFO) - elif verbosity > 1: - self.logger.setLevel(logging.DEBUG) - - # verbosity 3: also enable all logging statements that reach the root - # logger - if verbosity > 2: - logging.getLogger().setLevel(logging.DEBUG) - def add_arguments(self, parser): parser.add_argument('customer_email', nargs='+', type=str) def handle(self, *args, **options): - self.set_logger(options.get('verbosity')) try: for email in options['customer_email']: stripe_utils = StripeUtils()