ABLATE Source Documentation  0.12.34
streamLog.hpp
1 #ifndef ABLATELIBRARY_STREAMLOG_HPP
2 #define ABLATELIBRARY_STREAMLOG_HPP
3 
4 #include <iostream>
5 #include <vector>
6 #include "log.hpp"
7 
8 namespace ablate::monitors::logs {
9 class StreamLog : public Log {
10  private:
11  std::ostream& stream;
12  std::vector<char> buffer;
13 
14  public:
15  explicit StreamLog(std::ostream& stream = std::cout);
16  // allow access to all print from base
17  using Log::Print;
18  void Print(const char*) override;
19  void Printf(const char*, ...) override;
20 
21  void Initialize(MPI_Comm comm) override;
22 
27  std::ostream& GetStream() override { return stream; }
28 };
29 } // namespace ablate::monitors::logs
30 
31 #endif // ABLATELIBRARY_STREAMLOG_HPP
Definition: log.hpp:10
Definition: streamLog.hpp:9
std::ostream & GetStream() override
Definition: streamLog.hpp:27