clangd writes log messages to stderr. In Linux, I need it to redirect stderr to a log file for future use, instead of console
the command I used is:
clangd --clang-tidy -compile-commands-dir=$SOME_PATH --log=error > $SOME_PATH/clangd.log 2>&1
It can start and redirect to the file, but after several seconds, clangd stops and has this error in the clangd.log file
I[18:10:31.484] clangd version 9.0.0 (https://github.com/llvm-mirror/llvm c62b24f070c9a4bb1a76409e623042a740cac4cd)
I[18:10:31.484] Working directory: ......
I[18:10:31.484] argv[0]: clangd
I[18:10:31.484] argv[1]: --clang-tidy
I[18:10:31.484] argv[2]: -compile-commands-dir=......
I[18:10:31.484] argv[3]: --log=error
I[18:10:31.484] Starting LSP over stdin/stdout
......
I[18:10:31.706] <-- initialize("1")
I[18:10:31.707] --> reply:initialize("1") 0 ms
Content-Length: 1038
......
V[18:10:41.710] <<< {"id":"2","jsonrpc":"2.0","method":"shutdown","params":null}
I[18:10:41.711] <-- shutdown("2")
I[18:10:41.711] --> reply:shutdown("2") 0 ms
Content-Length: 40
{"id":"2","jsonrpc":"2.0","result":null}V[18:10:41.711] >>> {"id":"2","jsonrpc":"2.0","result":null}
E[18:10:46.711] Transport error: Input/output error
What am I missing ? Why transport error ? to clangd process, it shouldn't be a problem whether the stderr is console or a file?
I just want to redirect stderr to a file instead of console. I don't want to show many logs in the console, which is annoying to users who don't care and is not good for developers to check the logs in the future.
Thanks in advance