about summary refs log tree commit diff
path: root/third_party/nix/src/libutil/compression.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-18T01·34+0100
committerVincent Ambo <tazjin@google.com>2020-05-18T01·34+0100
commit6dc6c29fa4a4ddd3bb72f8415fac5936d719bd44 (patch)
tree560a8389d1682465599d94193053811acfd5de37 /third_party/nix/src/libutil/compression.cc
parentc584480cd46fb49e690e931f326472e512a82878 (diff)
refactor(3p/nix/libutil): Replace internal logging library with glog r/754
Diffstat (limited to 'third_party/nix/src/libutil/compression.cc')
-rw-r--r--third_party/nix/src/libutil/compression.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/third_party/nix/src/libutil/compression.cc b/third_party/nix/src/libutil/compression.cc
index 39bde37e0fd4..1f284b097054 100644
--- a/third_party/nix/src/libutil/compression.cc
+++ b/third_party/nix/src/libutil/compression.cc
@@ -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?