aboutsummaryrefslogtreecommitdiff
path: root/src/nix/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-03-02 15:02:24 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-03-02 15:02:24 +0100
commitb69a73a2305aaee2a4da73da601dbde3f1ddd7a6 (patch)
tree4f9b64ba19120271c2ef1e2ecc3b104beb36770a /src/nix/main.cc
parent09f5975c6a0d8706b22f15e4c5998018e56484ae (diff)
Get rid of some unchecked calls to std::cout
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r--src/nix/main.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index d3d2f5b16..53bf649d4 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -292,7 +292,7 @@ void mainWrapped(int argc, char * * argv)
NixArgs args;
if (argc == 2 && std::string(argv[1]) == "__dump-args") {
- std::cout << args.toJSON().dump() << "\n";
+ logger->cout("%s", args.toJSON());
return;
}
@@ -312,7 +312,7 @@ void mainWrapped(int argc, char * * argv)
b["doc"] = trim(stripIndentation(primOp->doc));
res[state.symbols[builtin.name]] = std::move(b);
}
- std::cout << res.dump() << "\n";
+ logger->cout("%s", res);
return;
}
@@ -321,14 +321,14 @@ void mainWrapped(int argc, char * * argv)
if (completions) {
switch (completionType) {
case ctNormal:
- std::cout << "normal\n"; break;
+ logger->cout("normal"); break;
case ctFilenames:
- std::cout << "filenames\n"; break;
+ logger->cout("filenames"); break;
case ctAttrs:
- std::cout << "attrs\n"; break;
+ logger->cout("attrs"); break;
}
for (auto & s : *completions)
- std::cout << s.completion << "\t" << trim(s.description) << "\n";
+ logger->cout(s.completion + "\t" + trim(s.description));
}
});