Lugdunum  0.1.0
OstreamHandler.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <ostream>
4 #include <lug/System/Export.hpp>
6 
7 namespace lug {
8 namespace System {
9 namespace Logger {
10 
12 public:
13  OstreamHandler(const std::string& name, std::ostream& out);
14 
15  OstreamHandler(const OstreamHandler&) = delete;
16  OstreamHandler(OstreamHandler&&) = delete;
17 
18  OstreamHandler& operator=(const OstreamHandler&) = delete;
19  OstreamHandler& operator=(OstreamHandler&&) = delete;
20 
21  virtual ~OstreamHandler() = default;
22 
23  void handle(const priv::Message& msg) final;
24  void flush() final;
25 
26 private:
27  std::ostream& _os;
28 };
29 
31 public:
32  StdoutHandler(const std::string& name);
33 
34  StdoutHandler(const StdoutHandler&) = delete;
35  StdoutHandler(StdoutHandler&&) = delete;
36 
37  StdoutHandler& operator=(const StdoutHandler&) = delete;
38  StdoutHandler& operator=(StdoutHandler&&) = delete;
39 
40  ~StdoutHandler() = default;
41 };
42 
44 public:
45  StderrHandler(const std::string& name);
46 
47  StderrHandler(const StderrHandler&) = delete;
48  StderrHandler(StderrHandler&&) = delete;
49 
50  StderrHandler& operator=(const StderrHandler&) = delete;
51  StderrHandler& operator=(StderrHandler&&) = delete;
52 
53  ~StderrHandler() = default;
54 };
55 
56 } // Logger
57 } // System
58 } // lug
#define LUG_SYSTEM_API
Definition: Export.hpp:11