async def run(self, args: Namespace) -> None: # Set the log level on the base logger logging.getLogger().setLevel(args.log_level) name = self.__class__.__name__ self.logger.debug(f"{name} command run with: {args}") async with log_call( name=name, metadata=plugin.resolve_metadata(logger=self.logger)): await self._run_impl(args)
async def run(self, args: Namespace) -> None: # In order to keep the argparse compatible with old invocations # We should use the --log after command if set, otherwise use the pre-command --log logging.getLogger().setLevel(args.log_level_deprecated or args.log_level) name = self.__class__.__name__ self.logger.debug(f"{name} command run with: {args}") if args.log_level_deprecated is not None: self.logger.warning( f"Setting --log after the command is deprecated, please place it at the start of the invocation" ) async with log_call( name=name, metadata=plugin.resolve_metadata(logger=self.logger) ): await self._run_impl(args)