def handle(self, *args, **options):  # NoQA
        """
        Execute the command.

        """

        # Load the settings
        self.require_settings(args, options)

        # Load your AWS credentials from ~/.aws/credentials
        self.load_credentials()

        try:
            # Tail the available logs
            all_logs = self.zappa.fetch_logs(self.lambda_name)
            self.print_logs(all_logs)

            # Keep polling, and print any new logs.
            while True:
                all_logs_again = self.zappa.fetch_logs(self.lambda_name)
                new_logs = []
                for log in all_logs_again:
                    if log not in all_logs:
                        new_logs.append(log)

                self.print_logs(new_logs)
                all_logs = all_logs + new_logs
        except KeyboardInterrupt:
            # Die gracefully
            try:
                sys.exit(0)
            except SystemExit:
                os._exit(0)

        return
def handle ( self , * args , ** options ) : self . require_settings ( args , options ) self . load_credentials ( ) try : all_logs = self . zappa . fetch_logs ( self . lambda_name ) self . print_logs ( all_logs ) while True : all_logs_again = self . zappa . fetch_logs ( self . lambda_name ) new_logs = [ ] for log in all_logs_again : if log not in all_logs : new_logs . append ( log ) self . print_logs ( new_logs ) all_logs = all_logs + new_logs except KeyboardInterrupt : try : sys . exit ( 0 ) except SystemExit : os . _exit ( 0 ) return
Execute the command.