You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
509 B

  1. #pragma once
  2. #include <mutex>
  3. #include <cpputils/logging/consumer/consumer.h>
  4. namespace utl {
  5. namespace logging {
  6. struct consumer_stream : public consumer
  7. {
  8. private:
  9. mutable std::mutex _mutex;
  10. std::ostream* _stream;
  11. bool _ownsStream;
  12. public:
  13. void log(data_ptr_s data) override;
  14. consumer_stream(const std::string& name, std::ostream& stream, bool ownsStream, bool autoRegister);
  15. virtual ~consumer_stream();
  16. };
  17. }
  18. }