diff --git a/log/include/gz/utils/log/SplitSink.hh b/log/include/gz/utils/log/SplitSink.hh index 315ee73..9c7be63 100644 --- a/log/include/gz/utils/log/SplitSink.hh +++ b/log/include/gz/utils/log/SplitSink.hh @@ -18,8 +18,10 @@ #ifndef GZ_UTILS_LOG_SPLITSINK_HH_ #define GZ_UTILS_LOG_SPLITSINK_HH_ +#include #include #include +#include #include #include @@ -114,7 +116,7 @@ class SplitRingBufferSink: public spdlog::sinks::base_sink /// \brief No copy constructor. public: SplitRingBufferSink(const SplitRingBufferSink &) = delete; - /// \brief No asignment operator. + /// \brief No asignment operator. public: SplitRingBufferSink &operator=(const SplitRingBufferSink &) = delete; /// \brief ToDo. @@ -177,7 +179,7 @@ class SplitRingBufferSink: public spdlog::sinks::base_sink } /// \brief Set the logging pattern. - /// \param[in] _pattern The logging pattern. + /// \param[in] _pattern The logging pattern. protected: void set_pattern_(const std::string &_pattern) override { this->set_formatter_( diff --git a/log/src/SplitSink_TEST.cc b/log/src/SplitSink_TEST.cc index 8371bc1..4b19abe 100644 --- a/log/src/SplitSink_TEST.cc +++ b/log/src/SplitSink_TEST.cc @@ -23,9 +23,9 @@ ///////////////////////////////////////////////// TEST(SplitConsoleSink, foo) { - auto split_sink = std::make_shared(); + auto splitSink = std::make_shared(); - spdlog::logger logger("split_sink", {split_sink}); + spdlog::logger logger("split_sink", {splitSink}); logger.set_level(spdlog::level::trace); logger.trace("trace"); @@ -39,10 +39,12 @@ TEST(SplitConsoleSink, foo) ///////////////////////////////////////////////// TEST(SplitRingBufferSink, foo) { - auto split_sink = std::make_shared>(); - auto split_sink_console = std::make_shared(); + auto splitSink = + std::make_shared>(); + auto splitSinkConsole = + std::make_shared(); - spdlog::logger logger("split_sink", {split_sink, split_sink_console}); + spdlog::logger logger("split_sink", {splitSink, splitSinkConsole}); logger.set_level(spdlog::level::trace); logger.trace("trace"); @@ -53,14 +55,14 @@ TEST(SplitRingBufferSink, foo) logger.critical("critical"); { - auto logs = split_sink->last_raw_stdout(); + auto logs = splitSink->last_raw_stdout(); EXPECT_EQ(logs[0].payload, "trace"); EXPECT_EQ(logs[1].payload, "debug"); EXPECT_EQ(logs[2].payload, "info"); } { - auto logs = split_sink->last_raw_stderr(); + auto logs = splitSink->last_raw_stderr(); EXPECT_EQ(logs[0].payload, "warn"); EXPECT_EQ(logs[1].payload, "error"); EXPECT_EQ(logs[2].payload, "critical");