aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2023-01-13 20:16:33 +0100
committerGitHub <noreply@github.com>2023-01-13 20:16:33 +0100
commitfec527bba1fb08f2382db67d210965d895bd0371 (patch)
tree00b0dad2470d9e3b286e2dcf26f7aded05e7de78
parentd21f54958ebc3400ca41e0458338e6a90bd47fbe (diff)
parentb8a0e9a9b8f0499502d317b7424f6b59fd8b48fe (diff)
Merge pull request #7597 from tweag/move-implem-bit-to-implem-file
Move the `getBuildLog` implementation to its own implementation file
-rw-r--r--src/libstore/log-store.cc12
-rw-r--r--src/libstore/log-store.hh7
2 files changed, 13 insertions, 6 deletions
diff --git a/src/libstore/log-store.cc b/src/libstore/log-store.cc
new file mode 100644
index 000000000..8a26832ab
--- /dev/null
+++ b/src/libstore/log-store.cc
@@ -0,0 +1,12 @@
+#include "log-store.hh"
+
+namespace nix {
+
+std::optional<std::string> LogStore::getBuildLog(const StorePath & path) {
+ auto maybePath = getBuildDerivationPath(path);
+ if (!maybePath)
+ return std::nullopt;
+ return getBuildLogExact(maybePath.value());
+}
+
+}
diff --git a/src/libstore/log-store.hh b/src/libstore/log-store.hh
index b807e3e71..e4d95bab6 100644
--- a/src/libstore/log-store.hh
+++ b/src/libstore/log-store.hh
@@ -11,12 +11,7 @@ struct LogStore : public virtual Store
/* Return the build log of the specified store path, if available,
or null otherwise. */
- std::optional<std::string> getBuildLog(const StorePath & path) {
- auto maybePath = getBuildDerivationPath(path);
- if (!maybePath)
- return std::nullopt;
- return getBuildLogExact(maybePath.value());
- }
+ std::optional<std::string> getBuildLog(const StorePath & path);
virtual std::optional<std::string> getBuildLogExact(const StorePath & path) = 0;