avocado
avocado copied to clipboard
Improvements on our log system (big picture)
Tl;dr: This is an attempt to bond all logging issues related to this epic issue. Here we describe our problem and some room for improvements regarding our logging system.
During the last Avocado releases, its architecture has evolved considerably, however, even with some particular improvements, our logging mechanism is still in need of some care.
So far, we have adopted two relevant conventions: 1. We are avoiding the use of the root logger, saving everything inside the ‘avocado.*’ namespace; and 2. We are reserving the JOB_LOG ('avocado.test') only for logs related to the execution of the tests, in this way, each module starts logging in its namespace, using __name__
as logger name.
However, besides some minor changes on our current effort, we still have some room for improvements:
-
Logs outside a job's scope: With the new architecture, there is a need to log messages outside the scope of a job (messages that do not fit in job.log). For that, we need to define our handlers. Related issues:
- #5177
- #5120
- #4856
-
Configuration: Currently we do the configuration in code with several routines scattered in some places. In the current scenario, maybe this is no longer necessary and we should try to eliminate as much as possible this "logic in code" and use more the
logging.config
module from python itself. Here we still need to define some command line "helpers" that will be useful during the execution of jobs without the need to change those files. Related issues:- #5469
- #4856
- #4121
-
Documentation: We lack proper documentation here. It should be crystal clear to our users and contributors, what our handlers are and what namespaces they are acting on. Related issues:
@pevogam @clebergnu @richtja toughs?
@beraldoleal This sounds great and thanks for summarizing all logging-related issues and adaptations we need.
My only concern so far that we might break a lot of the already fixed logging issues so it would be great if we also have a way to test for missing logging messages and such. This wasn't trivial to detect so far and it took us multiple weeks of discoveries to identify these issues and now that most of them are fixed it would be great if we test for them (hopefully automatically) with more changes to come.