Added level to log_message (pandora_ha)

This commit is contained in:
fbsanchez 2021-09-21 12:48:57 +02:00
parent 2e764afac7
commit e9c5d89fdc
1 changed files with 6 additions and 3 deletions

View File

@ -49,11 +49,14 @@ my $Running = 0;
########################################################################
# Print the given message with a preceding timestamp.
########################################################################
sub log_message($$$) {
my ($conf, $source, $message) = @_;
sub log_message($$$;$) {
my ($conf, $source, $message, $verbosity_level) = @_;
my $level = $verbosity_level;
$level = 5 unless defined($level);
if (ref($conf) eq "HASH") {
logger($conf, 'HA (' . $source . ') ' . "$message", 5);
logger($conf, 'HA (' . $source . ') ' . "$message", $level);
}
if ($source eq '') {