aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/logging-json.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/logging-json.hh')
-rw-r--r--src/libutil/logging-json.hh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libutil/logging-json.hh b/src/libutil/logging-json.hh
new file mode 100644
index 000000000..8263ad707
--- /dev/null
+++ b/src/libutil/logging-json.hh
@@ -0,0 +1,23 @@
+#pragma once
+///@file logging-json.hh
+///
+///@brief Logging functions for json specifically, split due to the cost of
+///including nlohmann.
+
+#include "logging.hh"
+
+#include <nlohmann/json_fwd.hpp>
+
+namespace nix {
+
+std::optional<nlohmann::json> parseJSONMessage(const std::string & msg);
+
+bool handleJSONLogMessage(nlohmann::json & json,
+ const Activity & act, std::map<ActivityId, Activity> & activities,
+ bool trusted);
+
+bool handleJSONLogMessage(const std::string & msg,
+ const Activity & act, std::map<ActivityId, Activity> & activities,
+ bool trusted);
+
+};