Skip to content

Allow bypassing log setup in the API use #1896

Description

@whg517

In my code, I wanted to create the virtual environment manually by calling def cli_run(args, options=None): , but when I ran it, I found that my log could not be obtained. Through searching, I found that you clarified the root log in the code, which made me unable to use my log object after running.

I wonder what you're doing this for? Do you use custom Log objects instead of cleaning the root Log ?

LOGGER.setLevel(logging.NOTSET)

def _clean_handlers(log):
for log_handler in list(log.handlers): # remove handlers of libraries
log.removeHandler(log_handler)

I now can do a patch or duplicate the code of cli_run, session_via_cli, and build_parser and remove the line _do_report_setup .

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions