jonathanstowe / Log-Syslog-Native

Provide access to the Native syslog facility on Unix-like systems for Raku
Artistic License 2.0
1 stars 3 forks source link

ident is not handled correctly #5

Open maros opened 1 month ago

maros commented 1 month ago

The following test script

use Log::Syslog::Native;
my $s = Log::Syslog::Native.new(
    facility => Log::Syslog::Native::News,
    ident => "test"
);
$s.log(Log::Syslog::Native::Info,"testing");

produces the following line in syslog (read via journalctl)

Sep 27 18:13:32 mko202408.ghwb testing[245896]: testing

whereas.

use Log::Syslog::Native;
my $s = Log::Syslog::Native.new(
    facility => Log::Syslog::Native::News,
    ident => "test"
);
$s.log(Log::Syslog::Native::Info,"just testing"); # includes whitespace in the log message

produces the following line in syslog (read via journalctl)

Sep 27 18:15:08 mko202408.ghwb /etc/localtime[246218]: just testing

Tested with Rakudo™ v2024.07. and Log::Syslog::Native<0.1.1> on debian 12.7

jonathanstowe commented 1 month ago

Yes, there was a mistake in the way that the const char *ident was being handled. I think the behaviour of the explicitly-managed helper changed three years and I didn't notice.

I'll try and release the fix this afternoon.

jonathanstowe commented 1 month ago

I've made v0.1.2 which should be fixed.