From 6175ecd4c4ba817c4620f66a75e1e11da7c7a8ca Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 18 Dec 2025 17:23:24 +0000 Subject: debug: move to hyprutils' logger (#12673) --- src/protocols/ColorManagement.cpp | 68 +++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/protocols/ColorManagement.cpp') diff --git a/src/protocols/ColorManagement.cpp b/src/protocols/ColorManagement.cpp index 408ade4d..4215a5e7 100644 --- a/src/protocols/ColorManagement.cpp +++ b/src/protocols/ColorManagement.cpp @@ -62,9 +62,9 @@ CColorManager::CColorManager(SP resource) : m_resource(resour m_resource->sendSupportedIntent(WP_COLOR_MANAGER_V1_RENDER_INTENT_RELATIVE_BPC); } - m_resource->setDestroy([](CWpColorManagerV1* r) { LOGM(TRACE, "Destroy WP_color_manager at {:x} (generated default)", (uintptr_t)r); }); + m_resource->setDestroy([](CWpColorManagerV1* r) { LOGM(Log::TRACE, "Destroy WP_color_manager at {:x} (generated default)", (uintptr_t)r); }); m_resource->setGetOutput([](CWpColorManagerV1* r, uint32_t id, wl_resource* output) { - LOGM(TRACE, "Get output for id={}, output={}", id, (uintptr_t)output); + LOGM(Log::TRACE, "Get output for id={}, output={}", id, (uintptr_t)output); const auto OUTPUTRESOURCE = CWLOutputResource::fromResource(output); @@ -80,11 +80,11 @@ CColorManager::CColorManager(SP resource) : m_resource(resour RESOURCE->m_self = RESOURCE; }); m_resource->setGetSurface([](CWpColorManagerV1* r, uint32_t id, wl_resource* surface) { - LOGM(TRACE, "Get surface for id={}, surface={}", id, (uintptr_t)surface); + LOGM(Log::TRACE, "Get surface for id={}, surface={}", id, (uintptr_t)surface); auto SURF = CWLSurfaceResource::fromResource(surface); if (!SURF) { - LOGM(ERR, "No surface for resource {}", (uintptr_t)surface); + LOGM(Log::ERR, "No surface for resource {}", (uintptr_t)surface); r->error(-1, "Invalid surface (2)"); return; } @@ -107,11 +107,11 @@ CColorManager::CColorManager(SP resource) : m_resource(resour SURF->m_colorManagement = RESOURCE; }); m_resource->setGetSurfaceFeedback([](CWpColorManagerV1* r, uint32_t id, wl_resource* surface) { - LOGM(TRACE, "Get feedback surface for id={}, surface={}", id, (uintptr_t)surface); + LOGM(Log::TRACE, "Get feedback surface for id={}, surface={}", id, (uintptr_t)surface); auto SURF = CWLSurfaceResource::fromResource(surface); if (!SURF) { - LOGM(ERR, "No surface for resource {}", (uintptr_t)surface); + LOGM(Log::ERR, "No surface for resource {}", (uintptr_t)surface); r->error(-1, "Invalid surface (2)"); return; } @@ -128,7 +128,7 @@ CColorManager::CColorManager(SP resource) : m_resource(resour RESOURCE->m_self = RESOURCE; }); m_resource->setCreateIccCreator([](CWpColorManagerV1* r, uint32_t id) { - LOGM(WARN, "New ICC creator for id={} (unsupported)", id); + LOGM(Log::WARN, "New ICC creator for id={} (unsupported)", id); if (!PROTO::colorManagement->m_debug) { r->error(WP_COLOR_MANAGER_V1_ERROR_UNSUPPORTED_FEATURE, "ICC profiles are not supported"); return; @@ -146,7 +146,7 @@ CColorManager::CColorManager(SP resource) : m_resource(resour RESOURCE->m_self = RESOURCE; }); m_resource->setCreateParametricCreator([](CWpColorManagerV1* r, uint32_t id) { - LOGM(TRACE, "New parametric creator for id={}", id); + LOGM(Log::TRACE, "New parametric creator for id={}", id); const auto RESOURCE = PROTO::colorManagement->m_parametricCreators.emplace_back( makeShared(makeShared(r->client(), r->version(), id))); @@ -160,7 +160,7 @@ CColorManager::CColorManager(SP resource) : m_resource(resour RESOURCE->m_self = RESOURCE; }); m_resource->setCreateWindowsScrgb([](CWpColorManagerV1* r, uint32_t id) { - LOGM(WARN, "New Windows scRGB description id={}", id); + LOGM(Log::WARN, "New Windows scRGB description id={}", id); const auto RESOURCE = PROTO::colorManagement->m_imageDescriptions.emplace_back( makeShared(makeShared(r->client(), r->version(), id), false)); @@ -204,7 +204,7 @@ CColorManagementOutput::CColorManagementOutput(SP re m_resource->setOnDestroy([this](CWpColorManagementOutputV1* r) { PROTO::colorManagement->destroyResource(this); }); m_resource->setGetImageDescription([this](CWpColorManagementOutputV1* r, uint32_t id) { - LOGM(TRACE, "Get image description for output={}, id={}", (uintptr_t)r, id); + LOGM(Log::TRACE, "Get image description for output={}, id={}", (uintptr_t)r, id); if (m_imageDescription.valid()) PROTO::colorManagement->destroyResource(m_imageDescription.get()); @@ -247,16 +247,16 @@ CColorManagementSurface::CColorManagementSurface(SP m_client = m_resource->client(); m_resource->setDestroy([this](CWpColorManagementSurfaceV1* r) { - LOGM(TRACE, "Destroy wp cm surface {}", (uintptr_t)m_surface); + LOGM(Log::TRACE, "Destroy wp cm surface {}", (uintptr_t)m_surface); PROTO::colorManagement->destroyResource(this); }); m_resource->setOnDestroy([this](CWpColorManagementSurfaceV1* r) { - LOGM(TRACE, "Destroy wp cm surface {}", (uintptr_t)m_surface); + LOGM(Log::TRACE, "Destroy wp cm surface {}", (uintptr_t)m_surface); PROTO::colorManagement->destroyResource(this); }); m_resource->setSetImageDescription([this](CWpColorManagementSurfaceV1* r, wl_resource* image_description, uint32_t render_intent) { - LOGM(TRACE, "Set image description for surface={}, desc={}, intent={}", (uintptr_t)r, (uintptr_t)image_description, render_intent); + LOGM(Log::TRACE, "Set image description for surface={}, desc={}, intent={}", (uintptr_t)r, (uintptr_t)image_description, render_intent); const auto PO = sc(wl_resource_get_user_data(image_description)); if (!PO) { // FIXME check validity @@ -279,7 +279,7 @@ CColorManagementSurface::CColorManagementSurface(SP m_imageDescription = imageDescription->get()->m_settings; }); m_resource->setUnsetImageDescription([this](CWpColorManagementSurfaceV1* r) { - LOGM(TRACE, "Unset image description for surface={}", (uintptr_t)r); + LOGM(Log::TRACE, "Unset image description for surface={}", (uintptr_t)r); m_imageDescription = SImageDescription{}; setHasImageDescription(false); }); @@ -295,7 +295,7 @@ wl_client* CColorManagementSurface::client() { const SImageDescription& CColorManagementSurface::imageDescription() { if (!hasImageDescription()) - LOGM(WARN, "Reading imageDescription while none set. Returns default or empty values"); + LOGM(Log::WARN, "Reading imageDescription while none set. Returns default or empty values"); return m_imageDescription; } @@ -344,16 +344,16 @@ CColorManagementFeedbackSurface::CColorManagementFeedbackSurface(SPclient(); m_resource->setDestroy([this](CWpColorManagementSurfaceFeedbackV1* r) { - LOGM(TRACE, "Destroy wp cm feedback surface {}", (uintptr_t)m_surface); + LOGM(Log::TRACE, "Destroy wp cm feedback surface {}", (uintptr_t)m_surface); PROTO::colorManagement->destroyResource(this); }); m_resource->setOnDestroy([this](CWpColorManagementSurfaceFeedbackV1* r) { - LOGM(TRACE, "Destroy wp cm feedback surface {}", (uintptr_t)m_surface); + LOGM(Log::TRACE, "Destroy wp cm feedback surface {}", (uintptr_t)m_surface); PROTO::colorManagement->destroyResource(this); }); m_resource->setGetPreferred([this](CWpColorManagementSurfaceFeedbackV1* r, uint32_t id) { - LOGM(TRACE, "Get preferred for id {}", id); + LOGM(Log::TRACE, "Get preferred for id {}", id); if (m_surface.expired()) { r->error(WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_ERROR_INERT, "Surface is inert"); @@ -376,7 +376,7 @@ CColorManagementFeedbackSurface::CColorManagementFeedbackSurface(SPsetGetPreferredParametric([this](CWpColorManagementSurfaceFeedbackV1* r, uint32_t id) { - LOGM(TRACE, "Get preferred for id {}", id); + LOGM(Log::TRACE, "Get preferred for id {}", id); if (m_surface.expired()) { r->error(WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_ERROR_INERT, "Surface is inert"); @@ -397,7 +397,7 @@ CColorManagementFeedbackSurface::CColorManagementFeedbackSurface(SPm_settings.updateId(); if (!PROTO::colorManagement->m_debug && RESOURCE->m_settings.icc.fd >= 0) { - LOGM(ERR, "FIXME: parse icc profile"); + LOGM(Log::ERR, "FIXME: parse icc profile"); r->error(WP_COLOR_MANAGER_V1_ERROR_UNSUPPORTED_FEATURE, "ICC profiles are not supported"); return; } @@ -434,7 +434,7 @@ CColorManagementIccCreator::CColorManagementIccCreator(SPsetOnDestroy([this](CWpImageDescriptionCreatorIccV1* r) { PROTO::colorManagement->destroyResource(this); }); m_resource->setCreate([this](CWpImageDescriptionCreatorIccV1* r, uint32_t id) { - LOGM(TRACE, "Create image description from icc for id {}", id); + LOGM(Log::TRACE, "Create image description from icc for id {}", id); // FIXME actually check completeness if (m_settings.icc.fd < 0 || !m_settings.icc.length) { @@ -451,7 +451,7 @@ CColorManagementIccCreator::CColorManagementIccCreator(SPsetOnDestroy([this](CWpImageDescriptionCreatorParamsV1* r) { PROTO::colorManagement->destroyResource(this); }); m_resource->setCreate([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t id) { - LOGM(TRACE, "Create image description from params for id {}", id); + LOGM(Log::TRACE, "Create image description from params for id {}", id); // FIXME actually check completeness if (!m_valuesSet) { @@ -520,7 +520,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPdestroyResource(this); }); m_resource->setSetTfNamed([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t tf) { - LOGM(TRACE, "Set image description transfer function to {}", tf); + LOGM(Log::TRACE, "Set image description transfer function to {}", tf); if (m_valuesSet & PC_TF) { r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Transfer function already set"); return; @@ -547,7 +547,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetTfPower([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t eexp) { - LOGM(TRACE, "Set image description tf power to {}", eexp); + LOGM(Log::TRACE, "Set image description tf power to {}", eexp); if (m_valuesSet & PC_TF_POWER) { r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Transfer function power already set"); return; @@ -564,7 +564,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetPrimariesNamed([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t primaries) { - LOGM(TRACE, "Set image description primaries by name {}", primaries); + LOGM(Log::TRACE, "Set image description primaries by name {}", primaries); if (m_valuesSet & PC_PRIMARIES) { r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Primaries already set"); return; @@ -594,7 +594,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetPrimaries( [this](CWpImageDescriptionCreatorParamsV1* r, int32_t r_x, int32_t r_y, int32_t g_x, int32_t g_y, int32_t b_x, int32_t b_y, int32_t w_x, int32_t w_y) { - LOGM(TRACE, "Set image description primaries by values r:{},{} g:{},{} b:{},{} w:{},{}", r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y); + LOGM(Log::TRACE, "Set image description primaries by values r:{},{} g:{},{} b:{},{} w:{},{}", r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y); if (m_valuesSet & PC_PRIMARIES) { r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Primaries already set"); return; @@ -608,7 +608,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetLuminances([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t min_lum, uint32_t max_lum, uint32_t reference_lum) { auto min = min_lum / 10000.0f; - LOGM(TRACE, "Set image description luminances to {} - {} ({})", min, max_lum, reference_lum); + LOGM(Log::TRACE, "Set image description luminances to {} - {} ({})", min, max_lum, reference_lum); if (m_valuesSet & PC_LUMINANCES) { r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Luminances already set"); return; @@ -622,7 +622,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetMasteringDisplayPrimaries( [this](CWpImageDescriptionCreatorParamsV1* r, int32_t r_x, int32_t r_y, int32_t g_x, int32_t g_y, int32_t b_x, int32_t b_y, int32_t w_x, int32_t w_y) { - LOGM(TRACE, "Set image description mastering primaries by values r:{},{} g:{},{} b:{},{} w:{},{}", r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y); + LOGM(Log::TRACE, "Set image description mastering primaries by values r:{},{} g:{},{} b:{},{} w:{},{}", r_x, r_y, g_x, g_y, b_x, b_y, w_x, w_y); if (m_valuesSet & PC_MASTERING_PRIMARIES) { r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Mastering primaries already set"); return; @@ -644,7 +644,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetMasteringLuminance([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t min_lum, uint32_t max_lum) { auto min = min_lum / 10000.0f; - LOGM(TRACE, "Set image description mastering luminances to {} - {}", min, max_lum); + LOGM(Log::TRACE, "Set image description mastering luminances to {} - {}", min, max_lum); // if (valuesSet & PC_MASTERING_LUMINANCES) { // r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Mastering luminances already set"); // return; @@ -661,7 +661,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetMaxCll([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t max_cll) { - LOGM(TRACE, "Set image description max content light level to {}", max_cll); + LOGM(Log::TRACE, "Set image description max content light level to {}", max_cll); // if (valuesSet & PC_CLL) { // r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Max CLL already set"); // return; @@ -670,7 +670,7 @@ CColorManagementParametricCreator::CColorManagementParametricCreator(SPsetSetMaxFall([this](CWpImageDescriptionCreatorParamsV1* r, uint32_t max_fall) { - LOGM(TRACE, "Set image description max frame-average light level to {}", max_fall); + LOGM(Log::TRACE, "Set image description max frame-average light level to {}", max_fall); // if (valuesSet & PC_FALL) { // r->error(WP_IMAGE_DESCRIPTION_CREATOR_PARAMS_V1_ERROR_ALREADY_SET, "Max FALL already set"); // return; @@ -699,7 +699,7 @@ CColorManagementImageDescription::CColorManagementImageDescription(SPsetOnDestroy([this](CWpImageDescriptionV1* r) { PROTO::colorManagement->destroyResource(this); }); m_resource->setGetInformation([this](CWpImageDescriptionV1* r, uint32_t id) { - LOGM(TRACE, "Get image information for image={}, id={}", (uintptr_t)r, id); + LOGM(Log::TRACE, "Get image information for image={}, id={}", (uintptr_t)r, id); if (!m_allowGetInformation) { r->error(WP_IMAGE_DESCRIPTION_V1_ERROR_NO_INFORMATION, "Image descriptions doesn't allow get_information request"); return; @@ -782,7 +782,7 @@ void CColorManagementProtocol::bindManager(wl_client* client, void* data, uint32 return; } - LOGM(TRACE, "New WP_color_manager at {:x}", (uintptr_t)RESOURCE.get()); + LOGM(Log::TRACE, "New WP_color_manager at {:x}", (uintptr_t)RESOURCE.get()); } void CColorManagementProtocol::onImagePreferredChanged(uint32_t preferredId) { -- cgit v1.2.3