aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/unified_agent_client/backend.h
blob: 41e8d146b3cf5ceae3f4fa06e07935c4adf0f5ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <library/cpp/unified_agent_client/client.h>

#include <library/cpp/logger/backend.h>
#include <library/cpp/logger/log.h>

namespace NUnifiedAgent {
    class IRecordConverter {
    public:
        virtual ~IRecordConverter() = default;

        virtual TClientMessage Convert(const TLogRecord&) const = 0;
    };

    THolder<IRecordConverter> MakeDefaultRecordConverter(bool stripTrailingNewLine = true);

    THolder<TLogBackend> AsLogBackend(const TClientSessionPtr& session, bool stripTrailingNewLine = true);

    THolder<TLogBackend> MakeLogBackend(const TClientParameters& parameters,
        const TSessionParameters& sessionParameters = {},
        THolder<IRecordConverter> recordConverter = {});

    THolder<::TLog> MakeLog(const TClientParameters& parameters,
        const TSessionParameters& sessionParameters = {},
        THolder<IRecordConverter> recordConverter = {});
}