backend.h 913 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <library/cpp/unified_agent_client/client.h>
  3. #include <library/cpp/logger/backend.h>
  4. #include <library/cpp/logger/log.h>
  5. namespace NUnifiedAgent {
  6. class IRecordConverter {
  7. public:
  8. virtual ~IRecordConverter() = default;
  9. virtual TClientMessage Convert(const TLogRecord&) const = 0;
  10. };
  11. THolder<IRecordConverter> MakeDefaultRecordConverter(bool stripTrailingNewLine = true);
  12. THolder<TLogBackend> AsLogBackend(const TClientSessionPtr& session, bool stripTrailingNewLine = true);
  13. THolder<TLogBackend> MakeLogBackend(const TClientParameters& parameters,
  14. const TSessionParameters& sessionParameters = {},
  15. THolder<IRecordConverter> recordConverter = {});
  16. THolder<::TLog> MakeLog(const TClientParameters& parameters,
  17. const TSessionParameters& sessionParameters = {},
  18. THolder<IRecordConverter> recordConverter = {});
  19. }