I really love clickhouse logs. They helped me a lot of times, they 'tell stories' :) 

But on limited env (like tiny cloud instances) people often set the main log level from trace to information, or just disable it at all, keeping err log only - and motivation is very simple - logs are quite big, they take disk space & part of disk bandwidth - and that effect is very visible on tiny instances.

Maybe if we would compress them with LZ4 (streaming) it will be fewer reasons to disable them? 

What do you think of that? (I'm not totally convinced if it's good, because logs usually are expected to be straight and simple). 
#include <Common/getHashOfLoadedBinary.h>
#include <Common/Elf.h>
#include <filesystem>
#include <Common/config_version.h>
#if defined(OS_DARWIN)
#   pragma GCC diagnostic ignored "-Wunused-macros"
#   define _XOPEN_SOURCE 700  // ucontext is not available without _XOPEN_SOURCE
#endif
#include <ucontext.h>
namespace fs = std::filesystem;
DB::PipeFDs signal_pipe;
/** Reset signal handler to the default and send signal to itself.
  * It's called from user signal handler to write core dump.
  */
static void call_default_signal_handler(int sig)
{
    signal(sig, SIG_DFL);
    raise(sig);
}
static constexpr size_t max_query_id_size = 127;
static const size_t signal_pipe_buf_size =
    sizeof(int)
    + sizeof(siginfo_t)
    + sizeof(ucontext_t)
    + sizeof(StackTrace)
    + sizeof(UInt32)
    + max_query_id_size + 1    
    + sizeof(void*);
using signal_function = void(int, siginfo_t*, void*);
static void writeSignalIDtoSignalPipe(int sig)