Closed sphuber closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 77.77%. Comparing base (
ef60b66
) to head (10e2de5
). Report is 115 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
All
verdi
commands automatically have the-v/--verbosity
option added. This option has a callbackset_log_level
that is invoked for each subcommand. The callback is supposed to callconfigure_logging
to setup the logging configuration.Besides it being unnecessary to call it multiple times for each subcommand, it would actually cause a bug in that once the profile storage would have been loaded (through the callback of the profile option), which would have called
configure_logging
withwith_orm=True
to make sure theDbLogHandler
was properly configured, another call toset_log_level
would callconfigure_logging
with the default values (wherewith_orm=False
) and so theDbLogHandler
would be removed. This would result in process log messages not being persisted in the database. This would be manifested when running an AiiDA process through a script invoked throughverdi
or any other CLI that uses the verbosity option provided byaiida-core
.Since the
set_log_level
only has to make sure that the logging is configured at least once, a guard is added to skip the configuration once theaiida.common.log.CLI_ACTIVE
global has been set by a previous invocation.