diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2024-08-15 18:16:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-15 17:16:18 +0100 |
| commit | 12d9901472c6f9128fa8b16c25b3a879d1859e60 (patch) | |
| tree | dabd4f190454d95c5a20ad8e9c840d116e790157 /src/protocols/MesaDRM.cpp | |
| parent | 15f942000ef53776852d6d9dfd303e691aed73e3 (diff) | |
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.
Diffstat (limited to 'src/protocols/MesaDRM.cpp')
| -rw-r--r-- | src/protocols/MesaDRM.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/protocols/MesaDRM.cpp b/src/protocols/MesaDRM.cpp index ed412555..9fcd5f9b 100644 --- a/src/protocols/MesaDRM.cpp +++ b/src/protocols/MesaDRM.cpp @@ -4,8 +4,6 @@ #include "../Compositor.hpp" #include "types/WLBuffer.hpp" -#define LOGM PROTO::mesaDRM->protoLog - CMesaDRMBufferResource::CMesaDRMBufferResource(uint32_t id, wl_client* client, Aquamarine::SDMABUFAttrs attrs_) { LOGM(LOG, "Creating a Mesa dmabuf, with id {}: size {}, fmt {}, planes {}", id, attrs_.size, attrs_.format, attrs_.planes); for (int i = 0; i < attrs_.planes; ++i) { @@ -115,7 +113,7 @@ CMesaDRMProtocol::CMesaDRMProtocol(const wl_interface* iface, const int& ver, co drmDevice* dev = nullptr; int drmFD = g_pCompositor->m_iDRMFD; if (drmGetDevice2(drmFD, 0, &dev) != 0) { - protoLog(ERR, "Failed to get device, disabling MesaDRM"); + LOGM(ERR, "Failed to get device, disabling MesaDRM"); removeGlobal(); return; } @@ -126,13 +124,13 @@ CMesaDRMProtocol::CMesaDRMProtocol(const wl_interface* iface, const int& ver, co ASSERT(dev->available_nodes & (1 << DRM_NODE_PRIMARY)); if (!dev->nodes[DRM_NODE_PRIMARY]) { - protoLog(ERR, "No DRM render node available, both render and primary are null, disabling MesaDRM"); + LOGM(ERR, "No DRM render node available, both render and primary are null, disabling MesaDRM"); drmFreeDevice(&dev); removeGlobal(); return; } - protoLog(WARN, "No DRM render node, falling back to primary {}", dev->nodes[DRM_NODE_PRIMARY]); + LOGM(WARN, "No DRM render node, falling back to primary {}", dev->nodes[DRM_NODE_PRIMARY]); nodeName = dev->nodes[DRM_NODE_PRIMARY]; } drmFreeDevice(&dev); |
