diff --git a/frameworks/libhilog/BUILD.gn b/frameworks/libhilog/BUILD.gn index fe1a6623f28b1293597e14f5cd228e2a27a2cf48..94d831c69d0827370737d407861b05fd2ddeb695 100644 --- a/frameworks/libhilog/BUILD.gn +++ b/frameworks/libhilog/BUILD.gn @@ -133,6 +133,10 @@ ohos_source_set("libhilog_base_source") { "__RECV_MSG_WITH_UCRED_", "HILOG_PROHIBIT_ALLOCATION", ] + if (hilog_native_feature_ohcore) { + defines += [ "HILOG_OHCORE_VERSION" ] + } + public_configs = [ ":libhilog_base_config" ] configs = [ ":libhilog_base_config" ] diff --git a/frameworks/libhilog/base/hilog_base.cpp b/frameworks/libhilog/base/hilog_base.cpp index be974f150ae7e911b63273877345d7c86063dbe3..ecef5fad3c7616e4b80d152ba659387ff936ac5d 100644 --- a/frameworks/libhilog/base/hilog_base.cpp +++ b/frameworks/libhilog/base/hilog_base.cpp @@ -92,7 +92,9 @@ static int CheckConnection(SocketHandler& socketHandler) auto result = TEMP_FAILURE_RETRY(connect(socketHandler.socketFd.load(), reinterpret_cast(&SOCKET_ADDR), sizeof(SOCKET_ADDR))); if (result < 0) { +#ifndef HILOG_OHCORE_VERSION std::cerr << "Can't connect to hilog server. Errno: " << errno << "\n"; +#endif return result; } socketHandler.isConnected.store(true);