facebook / facebook/zstd

Unable to set log level to 2 when stderr isn't tty

Đang mở
#2,948 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
27.9k
Fork
2.6k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
8

Mô tả

Setting to other log levels do work. Only level=2 (the default) is broken. This breaks things like GNU parallel.
Removing the following line make it work again:
```
diff -pru zstd-1.5.1.orig/programs/zstdcli.c zstd-1.5.1/programs/zstdcli.c
--- zstd-1.5.1.orig/programs/zstdcli.c<>2021-12-20 22:49:18.000000000 +0000
+++ zstd-1.5.1/programs/zstdcli.c<->2021-12-22 15:21:02.979589075 +0000
@@ -1402,8 +1402,6 @@ int main(int argCount, const char* argv[
/* No status message in pipe mode (stdin - stdout) */
hasStdout = outFileName && !strcmp(outFileName,stdoutmark);

- if ((hasStdout || !IS_CONSOLE(stderr)) && (g_displayLevel==2)) g_displayLevel=1;
-
/* IO Stream/File */
FIO_setHasStdoutOutput(fCtx, hasStdout);
FIO_setNbFilesTotal(fCtx, (int)filenames->tableSize);
```
No time to file a pull request. Sorry! Too busy at work.

BTW, stdio redirection doesn't necessarily mean to/from pipes. They (stdin, stdout, stderr) can also be regular files, but this is another bug that I have no time to report at present.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.