protocols: refactor protocol logging to a macro (#7324)

this avoids the usage of the unique_ptr PROTO::protocol before it has
been constructed incase one wants to log something inside the
constructor itself, move the logging to macros and print file:linenumber
on ERR,CRIT,WARN and classname on the rest of the levels.
This commit is contained in:
Tom Englund 2024-08-15 18:16:18 +02:00 committed by GitHub
parent 15f942000e
commit 12d9901472
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 42 additions and 104 deletions

View file

@ -21,7 +21,7 @@ IWaylandProtocol::IWaylandProtocol(const wl_interface* iface, const int& ver, co
m_pGlobal = wl_global_create(g_pCompositor->m_sWLDisplay, iface, ver, this, &bindManagerInternal);
if (!m_pGlobal) {
protoLog(ERR, "could not create a global");
LOGM(ERR, "could not create a global [{}]", m_szName);
return;
}
@ -30,7 +30,7 @@ IWaylandProtocol::IWaylandProtocol(const wl_interface* iface, const int& ver, co
m_liDisplayDestroy.parent = this;
wl_display_add_destroy_listener(g_pCompositor->m_sWLDisplay, &m_liDisplayDestroy.listener);
protoLog(LOG, "Registered global");
LOGM(LOG, "Registered global [{}]", m_szName);
}
IWaylandProtocol::~IWaylandProtocol() {