Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandor Magyar <SMagyar@aphysci.com>2022-10-19 17:08:54 +0300
committerSandor Magyar <SMagyar@aphysci.com>2022-10-19 17:08:54 +0300
commitb5d361fc218e37028692bd30163766f091fdbbcc (patch)
tree3f25674379bfb8c2001500233cbdaba72e9c326a
parent0674e79066fbf9eaa0b9f65a3baa7a1e59b5e78d (diff)
clang-format mongo_sink.h
-rw-r--r--include/spdlog/sinks/mongo_sink.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/spdlog/sinks/mongo_sink.h b/include/spdlog/sinks/mongo_sink.h
index ca16d665..73184a9d 100644
--- a/include/spdlog/sinks/mongo_sink.h
+++ b/include/spdlog/sinks/mongo_sink.h
@@ -31,15 +31,15 @@ class mongo_sink : public base_sink<Mutex>
{
public:
mongo_sink(const std::string &db_name, const std::string &collection_name, const std::string &uri = "mongodb://localhost:27017")
- try
- : mongo_sink(std::make_shared<mongocxx::instance>(), db_name, collection_name, uri)
+ try : mongo_sink(std::make_shared<mongocxx::instance>(), db_name, collection_name, uri)
{}
catch (const mongocxx::exception &e)
{
throw_spdlog_ex(fmt_lib::format("Error opening database: {}", e.what()));
}
- mongo_sink(std::shared_ptr<mongocxx::instance> instance, const std::string &db_name, const std::string &collection_name, const std::string &uri = "mongodb://localhost:27017")
+ mongo_sink(std::shared_ptr<mongocxx::instance> instance, const std::string &db_name, const std::string &collection_name,
+ const std::string &uri = "mongodb://localhost:27017")
: instance_(std::move(instance))
, db_name_(db_name)
, coll_name_(collection_name)
@@ -67,10 +67,9 @@ protected:
if (client_ != nullptr)
{
- auto doc = document{} << "timestamp" << bsoncxx::types::b_date(msg.time)
- << "level" << level::to_string_view(msg.level).data() << "level_num" << msg.level
- << "message" << std::string(msg.payload.begin(), msg.payload.end()) << "logger_name"
- << std::string(msg.logger_name.begin(), msg.logger_name.end()) << "thread_id"
+ auto doc = document{} << "timestamp" << bsoncxx::types::b_date(msg.time) << "level" << level::to_string_view(msg.level).data()
+ << "level_num" << msg.level << "message" << std::string(msg.payload.begin(), msg.payload.end())
+ << "logger_name" << std::string(msg.logger_name.begin(), msg.logger_name.end()) << "thread_id"
<< static_cast<int>(msg.thread_id) << finalize;
client_->database(db_name_).collection(coll_name_).insert_one(doc.view());
}