|
|
@@ -24,10 +24,13 @@ public:
|
|
|
|
|
|
json_layout(properties const & props);
|
|
|
void format(std::ostream & os, logpacket const & pkt) const override;
|
|
|
-
|
|
|
+ std::string header() const override { return complete_ ? "[" : ""; }
|
|
|
+ std::string footer() const override { return complete_ ? "]" : ""; }
|
|
|
+ std::string separator() const override { return complete_ ? "," : ""; }
|
|
|
+
|
|
|
private:
|
|
|
Json::StreamWriterBuilder build;
|
|
|
- bool eol_, log_as_json_, include_location_;
|
|
|
+ bool eol_, log_as_json_, include_location_, complete_;
|
|
|
};
|
|
|
|
|
|
using namespace logging::property;
|
|
|
@@ -49,7 +52,8 @@ std::shared_ptr<layout> json_layout::create(properties const & props) {
|
|
|
json_layout::json_layout(properties const & props)
|
|
|
: eol_(props["eventEol"]),
|
|
|
log_as_json_(props["objectMessageAsJsonObject"]),
|
|
|
- include_location_(props["locationInfo"])
|
|
|
+ include_location_(props["locationInfo"]),
|
|
|
+ complete_(props["complete"])
|
|
|
{
|
|
|
build["indentation"] = props["compact"] ? "" : " ";
|
|
|
}
|