| 18 | logWithPython(const std::string& message, int level); |
| 19 | |
| 20 | class LOG |
| 21 | { |
| 22 | public: |
| 23 | // Constructors |
| 24 | LOG() |
| 25 | : msgLevel(INFO){}; |
| 26 | |
| 27 | explicit LOG(logLevel type) |
| 28 | { |
| 29 | msgLevel = type; |
| 30 | }; |
| 31 | |
| 32 | // Destructors |
| 33 | ~LOG() |
| 34 | { |
| 35 | logWithPython(buffer.str(), msgLevel); |
| 36 | }; |
| 37 | |
| 38 | // Operators |
| 39 | template<typename T> |
| 40 | LOG& operator<<(const T& msg) |
| 41 | { |
| 42 | buffer << msg; |
| 43 | return *this; |
| 44 | }; |
| 45 | |
| 46 | private: |
| 47 | // Data members |
| 48 | std::ostringstream buffer; |
| 49 | logLevel msgLevel = DEBUG; |
| 50 | }; |
| 51 | |
| 52 | void |
| 53 | initializePythonLoggerInterface(); |
no outgoing calls
no test coverage detected