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
This commit is contained in:
木头云 2025-12-15 08:33:43 +00:00
parent 78bbb05322
commit 2ec1914691

View File

@ -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();