Fast DDS  Version 3.0.0
Fast DDS
Loading...
Searching...
No Matches
StdoutErrConsumer.hpp
1// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef FASTDDS_DDS_LOG__STDOUTERRCONSUMER_HPP
16#define FASTDDS_DDS_LOG__STDOUTERRCONSUMER_HPP
17
18#include <fastdds/dds/log/Log.hpp>
19#include <fastdds/dds/log/OStreamConsumer.hpp>
20#include <iostream>
21
22namespace eprosima {
23namespace fastdds {
24namespace dds {
25
33{
34public:
35
36 virtual ~StdoutErrConsumer() = default;
37
47 FASTDDS_EXPORTED_API virtual void stderr_threshold(
48 const Log::Kind& kind);
49
54 FASTDDS_EXPORTED_API virtual Log::Kind stderr_threshold() const;
55
60
61protected:
62
67 FASTDDS_EXPORTED_API virtual std::ostream& get_stream(
68 const Log::Entry& entry) override;
69
70private:
71
72 Log::Kind stderr_threshold_ = STDERR_THRESHOLD_DEFAULT;
73
74};
75
76} // namespace dds
77} // namespace fastdds
78} // namespace eprosima
79
80#endif // FASTDDS_DDS_LOG__STDOUTERRCONSUMER_HPP
Kind
Types of log entry.
Definition Log.hpp:90
@ Warning
Definition Log.hpp:92
Definition OStreamConsumer.hpp:32
Definition StdoutErrConsumer.hpp:33
virtual FASTDDS_EXPORTED_API Log::Kind stderr_threshold() const
Retrieve the stderr_threshold.
static constexpr Log::Kind STDERR_THRESHOLD_DEFAULT
Default value of stderr_threshold.
Definition StdoutErrConsumer.hpp:59
virtual FASTDDS_EXPORTED_API std::ostream & get_stream(const Log::Entry &entry) override
virtual FASTDDS_EXPORTED_API void stderr_threshold(const Log::Kind &kind)
Set the stderr_threshold to a Log::Kind.
Definition DomainParticipant.hpp:45
eProsima namespace.
Definition Log.hpp:174