ifm3d
log_writer_composite.h
1 // -*- c++ -*-
2 /*
3  * Copyright 2023-present ifm electronic, gmbh
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef IFM3D_COMMON_LOGGING_LOG_WRITER_COMPOSITE_H
8 #define IFM3D_COMMON_LOGGING_LOG_WRITER_COMPOSITE_H
9 
10 #include <ifm3d/common/logging/log_writer.h>
11 
12 namespace ifm3d
13 {
15  {
16  public:
17  LogWriterComposite(std::vector<std::shared_ptr<LogWriter>> writers)
18  : writers_(writers)
19  {}
20 
21  void
22  Write(const LogEntry& entry) override
23  {
24  for (const auto& it : this->writers_)
25  {
26  it->Write(entry);
27  }
28  }
29 
30  protected:
31  std::vector<std::shared_ptr<LogWriter>> writers_;
32  };
33 }
34 #endif // IFM3D_COMMON_LOGGING_LOG_WRITER_COMPOSITE_H
ifm3d::LogWriterComposite
Definition: log_writer_composite.h:14
ifm3d::LogWriter
Definition: log_writer.h:14
ifm3d::LogEntry
Definition: log_entry.h:19