Improve Logger text escaping

This commit is contained in:
Pragmatic Software 2017-09-05 00:18:35 -07:00
parent c3938ed8bb
commit 5262934e0d
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ sub log {
my ($self, $text) = @_;
my $time = localtime;
$text =~ s/([\01-\010]|[\016-\037])/'\\' . ord $1/ge;
$text =~ s/(\P{PosixGraph})/my $ch = $1; if ($ch =~ m{[\s]}) { $ch } else { sprintf "\\x%02X", ord $ch }/ge;
if(defined $self->{log_file}) {
print PLOG_FILE "$time :: $text";