Log directly to STDOUT
This commit is contained in:
parent
7e43f9f600
commit
b0e1ead2b3
|
@ -144,7 +144,6 @@ sub get_active($self)
|
||||||
$self->do_log('LOG_WARNING',"No outputs detected.") unless (scalar(keys(%active)));
|
$self->do_log('LOG_WARNING',"No outputs detected.") unless (scalar(keys(%active)));
|
||||||
return \%active;
|
return \%active;
|
||||||
} else {
|
} else {
|
||||||
print "You haven't initialized get_outputs";
|
|
||||||
$self->do_log('LOG_WARNING',"Output list not defined yet. Try 'get_outputs()' first");
|
$self->do_log('LOG_WARNING',"Output list not defined yet. Try 'get_outputs()' first");
|
||||||
return \{};
|
return \{};
|
||||||
}
|
}
|
||||||
|
@ -251,24 +250,11 @@ sub do_log($self, $level, $msg, $die=0)
|
||||||
{
|
{
|
||||||
my $min = $self->{verbose} || 5;
|
my $min = $self->{verbose} || 5;
|
||||||
|
|
||||||
# Journald is borked. Just don't bother logging
|
# Journald module is borked. Just print to STDOUT and SystemD will catch it
|
||||||
return 0;
|
$msg = '(FATAL) ' . $msg if ($die);
|
||||||
if ($self->{daemon}) {
|
|
||||||
#use Log::Journald qw(send);
|
|
||||||
#send(
|
|
||||||
#PRIORITY => ERROR->{$level},
|
|
||||||
#MESSAGE => $msg,
|
|
||||||
#PERL_PACKAGE => 'Sway Wallpapers'
|
|
||||||
#) || warn "Could not send log ($level $msg): $!";
|
|
||||||
if ($die) {
|
|
||||||
$msg = '(FATAL) ' . $msg;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (ERROR->{$level} >= $min) {
|
if (ERROR->{$level} >= $min) {
|
||||||
printf("%11s %s\n", $level, $msg);
|
printf("%11s %s\n", $level, $msg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($die) {
|
if ($die) {
|
||||||
$self->clean();
|
$self->clean();
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue