python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.75k stars 187 forks source link

Silent Mode #531

Open david-backslash opened 4 months ago

david-backslash commented 4 months ago

I used the LSP for a huge amount of requests. It seems like the logs make it slowly and also, it gets stuck after some requests (50+-) It will be nice if you have some benchmark/performance tests you can share with me. Also attached a "silent mode" suggestion:

   # pyls/__main__.py:56 - ADD
    parser.add_argument(
        '-s', '--silent', action='count', default=0,
        help="Decrease verbosity of log output, overrides the verbosity & the log config file"
    )

    # pyls/__main__.py:66 - EDIT
     _configure_logger(args.verbose, args.log_config, args.log_file, args.silent)

    # pyls/__main__.py:103 - EDIT
    def _configure_logger(verbose=0, log_config=None, log_file=None, silent=0)

    # pyls/__main__.py:128 - EDIT
    if silent == 1:
       level = logging.ERROR
    elif silent >= 2:
        level = logging.CRITICAL