Verified Commit 368ed134 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

Log subprocess output only if we are on INFO level or higher

parent 750fde64
......@@ -167,7 +167,9 @@ struct c_log_subproc {
static ssize_t c_log_subproc_write(void *cookie, const char *buf, size_t size) {
struct c_log_subproc *cls = (struct c_log_subproc*)cookie;
int len = fwrite(buf, sizeof(char), size, cls->err ? stderr : stdout);
size_t len = size;
if (would_log(LL_INFO))
len = fwrite(buf, sizeof(char), size, cls->err ? stderr : stdout);
// This is memory buffer so there should be no problem to match system output
ASSERT(fwrite(buf, sizeof(char), len, cls->lsp->buffer.f) == len);
return len;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment