CompressLog: Add zstd compression

This commit is contained in:
Janne Heß
2022-06-12 17:57:49 +02:00
committed by Sandro Jäckel
parent 7de7122479
commit 2c886f51d3
4 changed files with 25 additions and 5 deletions

View File

@@ -16,7 +16,10 @@ sub process {
my $tail = int($c->stash->{tail} // "0");
if ($logPath =~ /\.bz2$/) {
if ($logPath =~ /\.zst$/) {
my $doTail = $tail ? "| tail -n '$tail'" : "";
open($fh, "-|", "zstd -dc < '$logPath' $doTail") or die;
} elsif ($logPath =~ /\.bz2$/) {
my $doTail = $tail ? "| tail -n '$tail'" : "";
open($fh, "-|", "bzip2 -dc < '$logPath' $doTail") or die;
} else {