From 2ec1914691d6f76f6e311825fa7dd7f64ba38f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=A4=B4=E4=BA=91?= <372449116@qq.com> Date: Mon, 15 Dec 2025 08:33:43 +0000 Subject: [PATCH] refactor(log): replace utility/log with imp/log in shm.cpp - Replace include "libipc/utility/log.h" with "libipc/imp/log.h" - Replace ipc::error() calls with LIBIPC_LOG() + log.error() - Use type-safe streaming interface instead of printf-style formatting - Remove manual newline characters from log messages --- src/libipc/shm.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libipc/shm.cpp b/src/libipc/shm.cpp index 40a374e..e7b9818 100755 --- a/src/libipc/shm.cpp +++ b/src/libipc/shm.cpp @@ -5,7 +5,7 @@ #include "libipc/shm.h" #include "libipc/utility/pimpl.h" -#include "libipc/utility/log.h" +#include "libipc/imp/log.h" #include "libipc/mem/resource.h" namespace ipc { @@ -69,12 +69,13 @@ void handle::sub_ref() noexcept { } bool handle::acquire(char const * name, std::size_t size, unsigned mode) { + LIBIPC_LOG(); if (!is_valid_string(name)) { - ipc::error("fail acquire: name is empty\n"); + log.error("fail acquire: name is empty"); return false; } if (size == 0) { - ipc::error("fail acquire: size is 0\n"); + log.error("fail acquire: size is 0"); return false; } release();