Francois Gouget : testbot: Standardize logging in the job scheduler.
Module: tools Branch: master Commit: 82c686c9b37270aae4d384896629dc198b2796ba URL: https://source.winehq.org/git/tools.git/?a=commit;h=82c686c9b37270aae4d38489... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Tue May 8 13:04:16 2018 +0200 testbot: Standardize logging in the job scheduler. Generic WineTestBot modules such as Jobs are supposed to let higher level layers handle the logging or errors. But since the job scheduler is part of the Engine it can log errors itself. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/Engine/Scheduler.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm index fbe1604..4eef3c9 100644 --- a/testbot/lib/WineTestBot/Engine/Scheduler.pm +++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm @@ -32,6 +32,7 @@ our @EXPORT = qw(ScheduleJobs CheckJobs); use WineTestBot::Config; use WineTestBot::Jobs; +use WineTestBot::Log; use WineTestBot::RecordGroups; use WineTestBot::VMs; @@ -306,8 +307,7 @@ sub _CheckAndClassifyVMs() } else { - require WineTestBot::Log; - WineTestBot::Log::LogMsg("Unexpected $VMKey status ". $VM->Status ."\n"); + LogMsg "Unexpected $VMKey status ". $VM->Status ."\n"; $FoundVMErrors = 1; # Don't interfere with this VM $Sched->{busyvms}->{$VMKey} = 1; @@ -352,8 +352,7 @@ sub _CheckAndClassifyVMs() } elsif ($VM->Status ne "off") { - require WineTestBot::Log; - WineTestBot::Log::LogMsg("Unexpected $VMKey status ". $VM->Status ."\n"); + LogMsg "Unexpected $VMKey status ". $VM->Status ."\n"; $FoundVMErrors = 1; # Don't interfere with this VM $Sched->{busyvms}->{$VMKey} = 1; @@ -738,8 +737,7 @@ sub _DumpHostCounters($$) my $HostKey = $VM->GetHost(); my $PrettyHost = ($PrettyHostNames ? $PrettyHostNames->{$HostKey} : "") || $HostKey; - require WineTestBot::Log; - WineTestBot::Log::LogMsg("$PrettyHost:$Counters\n") if ($Counters); + LogMsg "$PrettyHost:$Counters\n" if ($Counters); $Host->{dumpedcounters} = 1; } @@ -778,8 +776,7 @@ sub _DumpHostVMs($$$$) } my $PrettyHost = ($PrettyHostNames ? $PrettyHostNames->{$HostKey} : "") || $HostKey; - require WineTestBot::Log; - WineTestBot::Log::LogMsg("$PrettyHost: @VMInfo\n"); + LogMsg "$PrettyHost: @VMInfo\n"; $Host->{dumpedvms} = 1; }
participants (1)
-
Alexandre Julliard