From f79e674f38cbbb227fd7f6204946fb0b73858f56 Mon Sep 17 00:00:00 2001 From: Emillio Mariscal Date: Thu, 7 Dec 2023 20:44:46 -0300 Subject: [PATCH] Output JSON when running underpass --- src/replicator/replication.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/replicator/replication.cc b/src/replicator/replication.cc index 6f1174ca..1495627b 100644 --- a/src/replicator/replication.cc +++ b/src/replicator/replication.cc @@ -766,22 +766,24 @@ RemoteURL::RemoteURL(const RemoteURL &inr) void RemoteURL::dump(void) { - std::cerr << "\t------" << std::endl; - std::cerr << "\tDomain: " << domain << std::endl; - std::cerr << "\tDatadir: " << datadir << std::endl; - std::cerr << "\tSubpath: " << subpath << std::endl; - std::cerr << "\tURL: " << getURL() << std::endl; + std::cerr << "{" << std::endl; + std::cerr << "\t\"domain\": \"" << domain << "\"," << std::endl; + std::cerr << "\t\"datadir\": \"" << datadir << "\"," << std::endl; + std::cerr << "\t\"subpath\": \"" << subpath << "\"," << std::endl; + std::cerr << "\t\"url\": \"" << getURL() << "\"," << std::endl; std::map freqs; freqs[replication::minutely] = "minute"; freqs[replication::hourly] = "hour"; freqs[replication::daily] = "day"; freqs[replication::changeset] = "changeset"; - std::cerr << "\tFrequency: " << (int)frequency << std::endl; - std::cerr << "\tMajor: " << major << std::endl; - std::cerr << "\tMinor: " << minor << std::endl; - std::cerr << "\tIndex: " << index << std::endl; - std::cerr << "\tFilespec: " << filespec << std::endl; - std::cerr << "\tDestdir: " << destdir << std::endl; + std::cerr << "\t\"frequency\": " << (int)frequency << "," << std::endl; + std::cerr << "\t\"major\": " << major << "," << std::endl; + std::cerr << "\t\"minor\": " << minor << "," << std::endl; + std::cerr << "\t\"index\": " << index << "," << std::endl; + std::cerr << "\t\"filespec\": \"" << filespec << "\"," << std::endl; + std::cerr << "\t\"destdir\": \"" << destdir << "\"" << std::endl; + std::cerr << "}" << std::endl; + } Planet::Planet(const RemoteURL &url)