Bug 23896

Summary: logaction should pass the correct interface to Koha::Logger
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, hayleypelham, jonathan.druart, lucas, m.de.rooy, martin.renvoize
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21190
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03, 19.05.08, 18.11.14
Bug Depends on: 16436    
Bug Blocks:    
Attachments: Bug 23896: logaction should pass the correct interface to Koha::Logger
Bug 23896: Add unit tests
Bug 23896: logaction should pass the correct interface to Koha::Logger
Bug 23896: logaction should pass the correct interface to Koha::Logger
Bug 23896: logaction should pass the correct interface to Koha::Logger

Description Marcel de Rooy 2019-10-25 08:48:08 UTC
Look at
    my $logger = Koha::Logger->get(
        {
            interface => 'intranet',

while we have
 $interface //= C4::Context->interface;
Comment 1 Marcel de Rooy 2019-10-25 08:55:04 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2019-10-25 09:05:25 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2019-10-25 09:05:29 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2019-10-25 09:12:36 UTC
(In reply to Marcel de Rooy from comment #1)
> Will add a test for it, but building it on top of work in 21190

Well, I think I skip a test here. We need to mock AUTOLOAD in Koha::Logger and similar horrible stuff to just check a trivial parameter. Out of balance. No test is just easier.
Comment 5 Marcel de Rooy 2019-10-25 09:17:22 UTC
Created attachment 94721 [details] [review]
Bug 23896: logaction should pass the correct interface to Koha::Logger

Trivial fix.

Test plan:
Run t/db../Log.t to ensure that we did not break stuff.
If you set opac to debug in log4perl config, inspect opac-error.log to see
if you have extra loglines from running the test script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2020-01-29 13:12:37 UTC
This is a trivial oneliner patch and I waited three months for a signoff without any response. Taking the liberty to switch it to Signed off myself.
Comment 7 Jonathan Druart 2020-01-29 13:32:57 UTC
Please cover this change with a test :)
Comment 8 Martin Renvoize 2020-01-29 13:35:57 UTC
Created attachment 98080 [details] [review]
Bug 23896: logaction should pass the correct interface to Koha::Logger

Trivial fix.

Test plan:
Run t/db../Log.t to ensure that we did not break stuff.
If you set opac to debug in log4perl config, inspect opac-error.log to see
if you have extra loglines from running the test script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Marcel de Rooy 2020-01-29 14:04:34 UTC
(In reply to Jonathan Druart from comment #7)
> Please cover this change with a test :)

IRC:
[14:36] <marcelr> did you see comment4 on the report btw? it justifies the absence of a test
[14:37] <marcelr> i considered it as out of balance
Comment 10 Jonathan Druart 2020-01-29 14:51:13 UTC
Created attachment 98085 [details] [review]
Bug 23896: logaction should pass the correct interface to Koha::Logger

Trivial fix.

Test plan:
Run t/db../Log.t to ensure that we did not break stuff.
If you set opac to debug in log4perl config, inspect opac-error.log to see
if you have extra loglines from running the test script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Martin Renvoize 2020-01-30 11:03:59 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 12 Joy Nelson 2020-02-10 23:23:44 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 13 Lucas Gass 2020-02-14 20:37:48 UTC
backported to 19.05.x for 19.05.08
Comment 14 Hayley Pelham 2020-02-18 00:50:31 UTC
Backported to 18.11.x for 18.11.14.