Create or Get an instance of the logger singleton
| 33 | |
| 34 | // Create or Get an instance of the logger singleton |
| 35 | ZmqLogger *ZmqLogger::Instance() |
| 36 | { |
| 37 | if (!m_pInstance) { |
| 38 | // Create the actual instance of logger only once |
| 39 | m_pInstance = new ZmqLogger; |
| 40 | |
| 41 | // init ZMQ variables |
| 42 | m_pInstance->context = NULL; |
| 43 | m_pInstance->publisher = NULL; |
| 44 | m_pInstance->connection = ""; |
| 45 | |
| 46 | // Default connection |
| 47 | m_pInstance->Connection("tcp://*:5556"); |
| 48 | |
| 49 | // Init enabled to False (force user to call Enable()) |
| 50 | m_pInstance->enabled = false; |
| 51 | |
| 52 | #if USE_RESVG == 1 |
| 53 | // Init resvg logging (if needed) |
| 54 | // This can only happen 1 time or it will crash |
| 55 | ResvgRenderer::initLog(); |
| 56 | #endif |
| 57 | } |
| 58 | |
| 59 | return m_pInstance; |
| 60 | } |
| 61 | |
| 62 | // Set the connection for this logger |
| 63 | void ZmqLogger::Connection(std::string new_connection) |
nothing calls this directly
no test coverage detected