-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e3sm_to_cmip --help creates a logs directory #220
Comments
@tomvothecoder @chengzhuzhang (Just wondering if you have any insights here, before I begin culling/refactoring code.) In main.py, soon after the import:
a global variable "log_filename" is defined:
The The ONLY place this global variable is addressed is in the instantiation of class E3SMtoCMIP, where it simply serves to announce the logfile path (ironically, into the logfile):
I will remedy this situation by moving the call to For Additional Edification: There is a There is a The ONLY codes that calls either of these functions (specifically, the one in util.py) are these 3 cmor_handlers for mpas vars:
Add to this, there is a
Specifically via:
which appears to invoke only the default parameter values. The "help" declares:
processed by
and assigned via
In testing, setting "--logdir=<user_defined_path>" had no effect upon the local creation of 'logs/". As if this is not enough, the "_logger.py" module ( def _setup_root_logger() ) ALSO creates a local "logs/" directory. This issue (#220), as well as (#229 "Logger is printing duplicate messages") should be fixed in due course. |
@TonyB9000 it would be nice to fixing logger. It is minor but has been an annoyance. It looks like you already have a good plan to fix, if in this case go for it. We do want to place priority on the Omon/SImon issue though. |
@chengzhuzhang I agree, and I will attempt to use Tom's "python-test" method of running the e2c test, so that in-depth debugging can be employed. That, however, will be a very slow process for me - learning curve, etc. |
Moving the _setup_root_logger() until AFTER arg_parsing is called suffices to solve the unwanted "logs/" directory creation upon "--help" or "--version", as the process exits immediately after arg parsing in such cases. The issue of log-duplication (and triplication), #229, will be addressed separately. |
In Addition: Moving _setup_root_logger() until AFTER arg_parsing allows that the argument "--logdir" can now be passed into the logger setup, overriding the default "logs/" for routine processing. This was never captured as a separate issue. I intend to test with a version eliding the "console_handler" codes, just to see if this is driving the message duplication. Routinely, I issue |
Duplicate of #274 |
Simply issuing "e3sm_to_cmip --help" creates a "logs" directory in your current working directory, and an empty logfile.
(version 1.10.0rc1). Same for "e3sm_to_cmip --version".
The text was updated successfully, but these errors were encountered: