aboutsummaryrefslogtreecommitdiffstats
path: root/modules/log_json.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-28 21:32:23 +0000
committerGravatar Sadie Powell2026-03-29 00:42:15 +0000
commitcbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch)
tree48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/log_json.cpp
parentMove service code from base to its own header. (diff)
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/log_json.cpp')
-rw-r--r--modules/log_json.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/log_json.cpp b/modules/log_json.cpp
index ca6c11240..cef88619e 100644
--- a/modules/log_json.cpp
+++ b/modules/log_json.cpp
@@ -116,7 +116,7 @@ class JSONFileEngine final
: public Log::Engine
{
public:
- JSONFileEngine(Module* Creator) ATTR_NOT_NULL(2)
+ JSONFileEngine(const WeakModulePtr& Creator)
: Log::Engine(Creator, "json")
{
}
@@ -147,7 +147,7 @@ private:
FILE* file;
public:
- JSONStreamEngine(Module* Creator, const std::string& Name, FILE* fh) ATTR_NOT_NULL(2, 4)
+ JSONStreamEngine(const WeakModulePtr& Creator, const std::string& Name, FILE* fh) ATTR_NOT_NULL(4)
: Log::Engine(Creator, Name)
, file(fh)
{
@@ -170,9 +170,9 @@ private:
public:
ModuleLogJSON()
: Module(VF_VENDOR, "Provides the ability to log to JSON.")
- , log(this)
- , stderrlog(this, "json-stderr", stderr)
- , stdoutlog(this, "json-stdout", stdout)
+ , log(weak_from_this())
+ , stderrlog(weak_from_this(), "json-stderr", stderr)
+ , stdoutlog(weak_from_this(), "json-stdout", stdout)
{
}