|
- #include <cstring>
- #include <iomanip>
-
- #include <cpplogging/manager/manager.h>
- #include <cpplogging/manager/consumer/consumer_stream.h>
-
- using namespace ::cpplogging;
-
- consumer_stream::consumer_stream(
- const std::string& name,
- std::ostream& stream,
- const std::string& format)
- : consumer (name, format)
- , _stream (stream)
- , _storage (nullptr)
- { }
-
- consumer_stream::consumer_stream(
- const std::string& name,
- stream_ptr_u&& stream,
- const std::string& format)
- : consumer (name, format)
- , _stream (*stream)
- , _storage (std::move(stream))
- { }
-
- void consumer_stream::write_entry(const log_entry_ptr_s& entry) const
- {
- std::lock_guard<std::mutex> lk(_mutex);
- write_formatted(*entry, _format, _stream);
- }
|