MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / Instance

Method Instance

src/ZmqLogger.cpp:35–60  ·  view source on GitHub ↗

Create or Get an instance of the logger singleton

Source from the content-addressed store, hash-verified

33
34// Create or Get an instance of the logger singleton
35ZmqLogger *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
63void ZmqLogger::Connection(std::string new_connection)

Callers

nothing calls this directly

Calls 1

ConnectionMethod · 0.80

Tested by

no test coverage detected