From fa37569a1609f93925063b5b8a83d0e2fb16816c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 13 Dec 2012 09:54:11 +0000 Subject: (bug_log) simplify using append_to_file() --- urpm/msg.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'urpm') diff --git a/urpm/msg.pm b/urpm/msg.pm index b062ee7f..010741a4 100644 --- a/urpm/msg.pm +++ b/urpm/msg.pm @@ -6,6 +6,7 @@ use strict; no warnings; use Exporter; use URPM; +use urpm::util; my $encoding; BEGIN { @@ -92,12 +93,7 @@ sub sys_log { defined &syslog and eval { syslog("info", @_) } } #- writes only to logfile, not to screen sub bug_log { - if ($::logfile) { - open my $fh, ">>$::logfile" - or die "Can't output to log file [$::logfile]: $!\n"; - print $fh @_; - close $fh; - } + append_to_file($::logfile, @_) if $::logfile; } sub ask_yes_or_no { -- cgit v1.2.1