Page MenuHomeSoftware Heritage

Support multiple log level specifications in the swh cli
ClosedPublic

Authored by olasd on Nov 27 2020, 5:35 PM.

Details

Summary

This allows users to pass multiple --log-level values to the swh cli, to allow
finer grained configuration of the logging of some modules, without having to
resort to a full-fledged, very verbose log config file.

Close T2819.

Test Plan

tox tests added

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D4627 (id=16420)

Could not rebase; Attempt merge onto 6f9779f4ab...

Updating 6f9779f..68a35f8
Fast-forward
 swh/core/cli/__init__.py      |  70 +++++++++++++++++++++++----
 swh/core/db/tests/test_cli.py |  63 ++++++++++--------------
 swh/core/tests/test_cli.py    | 109 +++++++++++++++++++++++++++++++++---------
 3 files changed, 170 insertions(+), 72 deletions(-)
Changes applied before test
commit 68a35f8a7375dc1c261ac270bf95637417e4cbcd
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Nov 27 17:33:50 2020 +0100

    Support multiple log level specifications in the swh cli
    
    This allows users to pass multiple --log-level values to the swh cli, to allow
    finer grained configuration of the logging of some modules, without having to
    resort to a full-fledged, very verbose log config file.
    
    Close T2819.

commit 4be641cb96af2f29b073f4199c206230709d6beb
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Nov 27 15:16:30 2020 +0100

    Make command-line tests a bit more resilient
    
    We now match the command line output per section, in a fuzzier way than before.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/171/ for more details.

LGTM. I was wondering if a regexp would not be simpler for the validation step, but it would make error message more generic and less user friendly.

This revision is now accepted and ready to land.Nov 30 2020, 10:39 AM