refactor(3p/nix/libutil): Replace internal logging library with glog

This commit is contained in:
Vincent Ambo 2020-05-18 02:34:41 +01:00
parent c584480cd4
commit 6dc6c29fa4
10 changed files with 76 additions and 44 deletions

View file

@ -7,7 +7,7 @@
#include <cstring>
#include <iostream>
#include "finally.hh"
#include "logging.hh"
#include "glog/logging.h"
#include "util.hh"
namespace nix {
@ -217,16 +217,18 @@ struct XzCompressionSink : CompressionSink {
ret = lzma_stream_encoder_mt(&strm, &mt_options);
done = true;
#else
printMsg(lvlError,
"warning: parallel XZ compression requested but not supported, "
"falling back to single-threaded compression");
LOG(ERROR) << "parallel XZ compression requested but not supported, "
<< "falling back to single-threaded compression";
#endif
}
if (!done) ret = lzma_easy_encoder(&strm, 6, LZMA_CHECK_CRC64);
if (!done) {
ret = lzma_easy_encoder(&strm, 6, LZMA_CHECK_CRC64);
}
if (ret != LZMA_OK)
if (ret != LZMA_OK) {
throw CompressionError("unable to initialise lzma encoder");
}
// FIXME: apply the x86 BCJ filter?