Strip control characters from log messages

This commit is contained in:
Pragmatic Software 2017-08-31 03:30:22 -07:00
parent 678d82676d
commit 5cd0f85e65
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ sub log {
my ($self, $text) = @_;
my $time = localtime;
$text =~ s/(?:[\01-\010]|[\016-\037])/^/g;
if(defined $self->{log_file}) {
print PLOG_FILE "$time :: $text";
}