feat: split console and file logging levels#2144
feat: split console and file logging levels#2144FabianHofmann wants to merge 1 commit intomasterfrom
Conversation
|
I disagree with removing the log messages. And i would prefer solving the multi index warning at atlite level. |
|
Fixed in PyPSA/atlite#501 |
The reason being? With the faster and parallel execution of the atlite-based rules, you can't see which log refers to which conversion. The main time benchmarking logs (which state the tech) we keep. Also snakemake rules have descriptive messages nowadays. I don't see a reason to keep such kind of descriptive logs. If it is about debugging we should change the logger mode at least. |
|
I think instead of removing log messages we should change where they are displayed. Ideally, we would create a logging sink that the snakemake logger plugin pulls up and then instead of showing the log messages on the console only forward them there. The console would then be replaced with an interactive tui where you see which jobs are running and you can choose to see the logs of them. As immediate solution, maybe we decide instead that info messages should only go into the log file and only warning messages are printed onto the console. I'd be fine with such a change happening globally in PyPSA-Eur (or locally for that matter) The only two things missing then to make log files more helpful would be: A bridge that ensures that progressbars also write a minimal version into the log, and a default exception trap that also logs exceptions into the log. |
Add console_level (default WARNING) and file_level (default = level) to LoggingConfig so INFO messages stay in the rule log file while the console stays readable under parallel execution.
97d977d to
13c1022
Compare
|
@coroa pr is taking a different approach now, see updated summary above. |
Changes proposed in this Pull Request
Splits the logging level between the console and the rule log file so that parallel atlite-based rules stay readable on the console while the log file still captures full
INFOoutput.configure_loggingnow sets per-handler levels:logging.level— root log level (unchanged default:INFO)logging.console_level— stream handler (new, default:WARNING)logging.file_level— file handler (new, defaults tolevel)Users who want the old behaviour set
logging.console_level: INFO.Follow-up on the discussion in #2144 (comment). The xarray MultiIndex fix has been dropped from this PR and is now tracked upstream in PyPSA/atlite#501.
Checklist
Required:
doc/release_notes.rst.