Bugzilla – Attachment 174673 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.75 KB, created by
Jonathan Druart
on 2024-11-18 10:31:54 UTC
(
hide
)
Description:
Bug 38299: Make filehandler optional for colored outputs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-18 10:31:54 UTC
Size:
1.75 KB
patch
obsolete
>From 7afea478b77b209172347e35f861cff215e03575 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> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 6cb3d6a78d8..41cd5b52412 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.34.1
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