Bug 38818

Summary: Add diag option to t::lib::Mocks::Logger
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Test SuiteAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Failed QA --- QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, kyle, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 38689    
Attachments: Bug 38818: Add diag option to t::lib::Mocks::Logger
Bug 38818: Add diag option to t::lib::Mocks::Logger
Bug 38818: Add diag option to t::lib::Mocks::Logger
Bug 38818: Add diag option to t::lib::Mocks::Logger

Description Martin Renvoize (ashimema) 2025-01-03 14:39:10 UTC
The logger testing module is handy, but having a diag option to output all log lines currently sitting in the logger object would be helpful.

This would aid in later debugging.
Comment 1 Martin Renvoize (ashimema) 2025-01-03 14:41:16 UTC
Created attachment 176120 [details] [review]
Bug 38818: Add diag option to t::lib::Mocks::Logger

This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.
Comment 2 Martin Renvoize (ashimema) 2025-01-03 16:09:21 UTC
Created attachment 176125 [details] [review]
Bug 38818: Add diag option to t::lib::Mocks::Logger

This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.
Comment 3 Martin Renvoize (ashimema) 2025-01-03 16:35:08 UTC
Created attachment 176126 [details] [review]
Bug 38818: Add diag option to t::lib::Mocks::Logger

This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.
Comment 4 Martin Renvoize (ashimema) 2025-01-03 16:36:55 UTC
This is tested nicely using bug 38689.. just uncomment the `#$logger->debug()` lines added to the unit tests in that bug and run the tests to see the pretty output this produces
Comment 5 Kyle M Hall (khall) 2025-01-10 17:57:09 UTC
Created attachment 176385 [details] [review]
Bug 38818: Add diag option to t::lib::Mocks::Logger

This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Katrin Fischer 2025-02-03 13:25:28 UTC
1) Unit tests

I think this was referring to testing the functionality, not unit tests?

(In reply to Martin Renvoize (ashimema) from comment #4)
> This is tested nicely using bug 38689.. just uncomment the
> `#$logger->debug()` lines added to the unit tests in that bug and run the
> tests to see the pretty output this produces

Could you please write some tests to cover the new method?


2) Typo

I was going to fix inline, but so we don't forget:

 FAIL	t/lib/Mocks/Logger.pm
   FAIL	  spelling
		 recieved ==> received