Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console_handler = logging.StreamHandler(sys.stdout)
file_handler.setLevel(API_LOG_LEVEL)
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))
if quiet:
console_handler.setLevel(logging.WARNING)
elif verbosity:
if verbosity > 1:
console_handler.setLevel(API_RESPONSE_LOG_LEVEL)
else:
console_handler.setLevel(API_LOG_LEVEL)
else:
console_handler.setLevel(logging.INFO)
custom_formatter = CustomFormatter()
console_handler.setFormatter(custom_formatter)
logger.addHandler(file_handler)
logger.addHandler(console_handler)
console_handler = logging.StreamHandler(sys.stdout)
file_handler.setLevel(API_LOG_LEVEL)
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))
if quiet:
console_handler.setLevel(logging.WARNING)
elif verbosity:
if verbosity > 1:
console_handler.setLevel(API_RESPONSE_LOG_LEVEL)
else:
console_handler.setLevel(API_LOG_LEVEL)
else:
console_handler.setLevel(logging.INFO)
custom_formatter = CustomFormatter()
console_handler.setFormatter(custom_formatter)
logger.addHandler(file_handler)
logger.addHandler(console_handler)
console_handler = logging.StreamHandler(sys.stdout)
file_handler.setLevel(API_LOG_LEVEL)
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))
if quiet:
console_handler.setLevel(logging.WARNING)
elif verbosity:
if verbosity > 1:
console_handler.setLevel(API_RESPONSE_LOG_LEVEL)
else:
console_handler.setLevel(API_LOG_LEVEL)
else:
console_handler.setLevel(logging.INFO)
custom_formatter = CustomFormatter()
console_handler.setFormatter(custom_formatter)
logger.addHandler(file_handler)
logger.addHandler(console_handler)
console_handler = logging.StreamHandler(sys.stdout)
file_handler.setLevel(API_LOG_LEVEL)
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))
if quiet:
console_handler.setLevel(logging.WARNING)
elif verbosity:
if verbosity > 1:
console_handler.setLevel(API_RESPONSE_LOG_LEVEL)
else:
console_handler.setLevel(API_LOG_LEVEL)
else:
console_handler.setLevel(logging.INFO)
custom_formatter = CustomFormatter()
console_handler.setFormatter(custom_formatter)
logger.addHandler(file_handler)
logger.addHandler(console_handler)
file_handler = logging.FileHandler(os.path.join(path, CONF_DIR, LOG_FN))
console_handler = logging.StreamHandler(sys.stdout)
file_handler.setLevel(API_LOG_LEVEL)
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))
if quiet:
console_handler.setLevel(logging.WARNING)
elif verbosity:
if verbosity > 1:
console_handler.setLevel(API_RESPONSE_LOG_LEVEL)
else:
console_handler.setLevel(API_LOG_LEVEL)
else:
console_handler.setLevel(logging.INFO)
custom_formatter = CustomFormatter()
console_handler.setFormatter(custom_formatter)
logger.addHandler(file_handler)
logger.addHandler(console_handler)