mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 02:21:34 +08:00
clone support in lite logger
This commit is contained in:
parent
9e5d1b3ba5
commit
4ccca079a5
@ -9,4 +9,8 @@ int main()
|
|||||||
l.info_printf("Hello %d", 12346);
|
l.info_printf("Hello %d", 12346);
|
||||||
l.warn_printf("Hello %f", 12346.5656);
|
l.warn_printf("Hello %f", 12346.5656);
|
||||||
l.warn("Hello {}", "LITE :) ");
|
l.warn("Hello {}", "LITE :) ");
|
||||||
|
|
||||||
|
auto l2 = l.clone("logger2");
|
||||||
|
l2.debug("HELLO");
|
||||||
|
|
||||||
}
|
}
|
@ -125,6 +125,11 @@ void spdlog::lite::logger::set_pattern(std::string pattern)
|
|||||||
impl_->set_pattern(std::move(pattern));
|
impl_->set_pattern(std::move(pattern));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spdlog::lite::logger spdlog::lite::logger::clone(std::string logger_name)
|
||||||
|
{
|
||||||
|
return spdlog::lite::logger(impl_->clone(std::move(logger_name)));
|
||||||
|
}
|
||||||
|
|
||||||
void spdlog::lite::logger::log_formatted_(spdlog::lite::level lvl, const fmt::memory_buffer &formatted)
|
void spdlog::lite::logger::log_formatted_(spdlog::lite::level lvl, const fmt::memory_buffer &formatted)
|
||||||
{
|
{
|
||||||
auto spd_level = to_spdlog_level(lvl);
|
auto spd_level = to_spdlog_level(lvl);
|
||||||
|
@ -174,6 +174,11 @@ public:
|
|||||||
//
|
//
|
||||||
void set_pattern(std::string pattern);
|
void set_pattern(std::string pattern);
|
||||||
|
|
||||||
|
//
|
||||||
|
//clone with new name
|
||||||
|
//
|
||||||
|
spdlog::lite::logger clone(std::string logger_name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<spdlog::logger> impl_;
|
std::shared_ptr<spdlog::logger> impl_;
|
||||||
void log_formatted_(lite::level lvl, const fmt::memory_buffer &formatted);
|
void log_formatted_(lite::level lvl, const fmt::memory_buffer &formatted);
|
||||||
|
Loading…
Reference in New Issue
Block a user