stream.h 723 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "backend.h"
  3. #include <util/generic/string.h>
  4. class IOutputStream;
  5. class TStreamLogBackend : public TLogBackend {
  6. public:
  7. explicit TStreamLogBackend(IOutputStream* slave);
  8. ~TStreamLogBackend() override;
  9. void WriteData(const TLogRecord& rec) override;
  10. void ReopenLog() override;
  11. private:
  12. IOutputStream* Slave_;
  13. };
  14. class TStreamWithContextLogBackend : public TLogBackend {
  15. private:
  16. static constexpr TStringBuf DELIMITER = "; ";
  17. public:
  18. explicit TStreamWithContextLogBackend(IOutputStream* slave);
  19. ~TStreamWithContextLogBackend() override;
  20. void WriteData(const TLogRecord& rec) override;
  21. void ReopenLog() override;
  22. private:
  23. IOutputStream* Slave_;
  24. };