Solution:
# If there's binary crap in here don't write that to my logs.
# Instead, throw [ASCII:24] and the like to the logs.
# -----
my $logable = $payload;
my $binary_char;
while (($binary_char) = ($logable =~ /([^ -~])/)) {
my $ord = "[ASCII:" . ord($binary_char) . "]";
$logable =~ s/\Q$binary_char\E/$ord/gs;
}
$logger->error("I don't understand payload '$logable'");
j