I have a python script with a cli argument parser (based on argparse) I am calling it from a batch file:
set VAR1=arg_1
set VAR2=arg_2
python script.py --arg1 %VAR1% --arg2 %VAR2%
within the script.py
I call a logger:
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
- This script utilizes chromedriver, selenium and requests to automate some clicking and moving between web pages.
- When running from within
PyCharm
(configured so that the script hasarg_1
andarg_2
passed to it) everything is great - I get log messages from my logger only. - When I run the batch file - I get a bunch of logging messages from chromedriver or requests (I think).
I have tried:
@echo off
at the start of the batch file.- Setting the level on the root logger.
- Getting the logging logger dictionary and setting each logger to WARNING - based on this question.
None of these work and I keep getting logging messages from submodules - ONLY when run from a batch file.
Anybody know how to fix this?