|
|
|
@ -148,7 +148,10 @@ sink& srslog::fetch_stderr_sink(const std::string& id, std::unique_ptr<log_forma
|
|
|
|
|
return *s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sink& srslog::fetch_file_sink(const std::string& path, size_t max_size, std::unique_ptr<log_formatter> f)
|
|
|
|
|
sink& srslog::fetch_file_sink(const std::string& path,
|
|
|
|
|
size_t max_size,
|
|
|
|
|
bool force_flush,
|
|
|
|
|
std::unique_ptr<log_formatter> f)
|
|
|
|
|
{
|
|
|
|
|
assert(!path.empty() && "Empty path string");
|
|
|
|
|
|
|
|
|
@ -161,7 +164,7 @@ sink& srslog::fetch_file_sink(const std::string& path, size_t max_size, std::uni
|
|
|
|
|
auto& s = srslog_instance::get().get_sink_repo().emplace(
|
|
|
|
|
std::piecewise_construct,
|
|
|
|
|
std::forward_as_tuple(path),
|
|
|
|
|
std::forward_as_tuple(new file_sink(path, max_size, std::move(f))));
|
|
|
|
|
std::forward_as_tuple(new file_sink(path, max_size, force_flush, std::move(f))));
|
|
|
|
|
|
|
|
|
|
return *s;
|
|
|
|
|
}
|
|
|
|
@ -388,7 +391,8 @@ sink* srslog::create_file_sink(const std::string& path, size_t max_size)
|
|
|
|
|
.get_sink_repo()
|
|
|
|
|
.emplace(std::piecewise_construct,
|
|
|
|
|
std::forward_as_tuple(path),
|
|
|
|
|
std::forward_as_tuple(new file_sink(path, max_size, std::unique_ptr<log_formatter>(new text_formatter))))
|
|
|
|
|
std::forward_as_tuple(
|
|
|
|
|
new file_sink(path, max_size, false, std::unique_ptr<log_formatter>(new text_formatter))))
|
|
|
|
|
.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|