Bugzilla – Attachment 174291 Details for
Bug 38299
Errors with updates caught in C4::Installer should be colored/highlighted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38299: Make filehandler optional for colored outputs
Bug-38299-Make-filehandler-optional-for-colored-ou.patch (text/plain), 1.68 KB, created by
David Nind
on 2024-11-08 19:29:33 UTC
(
hide
)
Description:
Bug 38299: Make filehandler optional for colored outputs
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-11-08 19:29:33 UTC
Size:
1.68 KB
patch
obsolete
>From 69835ba6a241b4b36f131c4e2b38809cf0f0436a Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Thu, 7 Nov 2024 10:21:19 -0500 >Subject: [PATCH] Bug 38299: Make filehandler optional for colored outputs > >Allow say_success, say_failure, etc, to omit the filehandler parameter >so that they can be used without explicitly opening a filehandler if you >are just printing to STDOUT and don't already have one. > >If a filehandler is passed, the existing behavior is unchanged. > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Installer/Output.pm | 28 ++++++++++++++++++++++++---- > 1 file changed, 24 insertions(+), 4 deletions(-) > >diff --git a/Koha/Installer/Output.pm b/Koha/Installer/Output.pm >index 6cb3d6a78d..41cd5b5241 100644 >--- a/Koha/Installer/Output.pm >+++ b/Koha/Installer/Output.pm >@@ -71,22 +71,42 @@ Output an informational message in blue. > > sub say_warning { > my ( $fh, $msg ) = @_; >- say $fh YELLOW, "$msg", RESET; >+ >+ if ($fh) { >+ say $fh YELLOW, "$msg", RESET; >+ } else { >+ say YELLOW, "$msg", RESET; >+ } > } > > sub say_failure { > my ( $fh, $msg ) = @_; >- say $fh RED, "$msg", RESET; >+ >+ if ($fh) { >+ say $fh RED, "$msg", RESET; >+ } else { >+ say RED, "$msg", RESET; >+ } > } > > sub say_success { > my ( $fh, $msg ) = @_; >- say $fh GREEN, "$msg", RESET; >+ >+ if ($fh) { >+ say $fh GREEN, "$msg", RESET; >+ } else { >+ say GREEN, "$msg", RESET; >+ } > } > > sub say_info { > my ( $fh, $msg ) = @_; >- say $fh BLUE, "$msg", RESET; >+ >+ if ($fh) { >+ say $fh BLUE, "$msg", RESET; >+ } else { >+ say BLUE, "$msg", RESET; >+ } > } > > =head1 AUTHORS >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38299
:
174250
|
174251
|
174252
|
174254
|
174255
|
174256
|
174259
|
174290
|
174291
|
174292
|
174293
|
174421
|
174423
|
174424
|
174455
|
174673
|
174674
|
174675
|
174676
|
174677