1
0
mirror of synced 2026-04-15 15:49:48 +00:00

Split helper functions logprint into logprint and logonly

This commit is contained in:
Axel Beckert
2010-05-17 02:09:47 +02:00
parent d670d13071
commit 7a3ab22439

View File

@@ -3617,6 +3617,28 @@ sub setupRootPassword
=begin doc
Print the given string to the logfile.
=end doc
=cut
sub logonly
{
my ($text) = (@_);
if ( $CONFIG{ 'hostname' } )
{
open( LOGFILE, ">>", "/var/log/xen-tools/$CONFIG{'hostname'}.log" ) or
return;
print LOGFILE $text;
close(LOGFILE);
}
}
=begin doc
Print the given string both to our screen, and to the logfile.
@@ -3630,17 +3652,7 @@ sub logprint
my ($text) = (@_);
print $text;
#
# Log.
#
if ( $CONFIG{ 'hostname' } )
{
open( LOGFILE, ">>", "/var/log/xen-tools/$CONFIG{'hostname'}.log" ) or
return;
print LOGFILE $text;
close(LOGFILE);
}
logonly($text);
}