diff -Naur Log-LogLite-0.82.orig/LogLite.pm Log-LogLite-0.82/LogLite.pm --- Log-LogLite-0.82.orig/LogLite.pm 2008-02-13 17:34:44.823135112 +0100 +++ Log-LogLite-0.82/LogLite.pm 2008-02-13 18:55:17.191134895 +0100 @@ -7,6 +7,7 @@ use Carp; use IO::LockedFile 0.21; +use Sys::Hostname; my $TEMPLATE = '[] <> '; @@ -70,6 +71,12 @@ $line =~ s!!$self->called_by()!igoe; $line =~ s!!$self->{DEFAULT_MESSAGE}!igo; $line =~ s!!$message!igo; + $line =~ s!!$$!igo; + $line =~ s!!$!$(!igo; # real group id + $line =~ s!!$>!igo; # effective user id + $line =~ s!!$)!igo; # effective group id + $line =~ s!!hostname_string()!igoe; print {$self->{FH}} $line; # unlock the file @@ -167,6 +174,19 @@ return $str; } # of called_by +####################### +# hostname_string() +####################### +{ + my $hostname; + + # hostname() croaks if the hostname is undeterminable, so catch this + # exception + eval { $hostname = hostname(); }; + + return ($@ ? "unknown" : $hostname); +} + 1; __END__ @@ -276,6 +296,13 @@ DEFAULT_MESSAGE data member. will be replaced by the message string that is sent to the C method. + will be replaced by the process number + will be replaced by the user id (real) + will be replaced by the group id (real) + will be replaced by the user id (effective) + will be replaced by the group id (effective) + will be replaced by the systems hostname or + "unknown", if not determinable Returns the value of the TEMPLATE data member.