From a003d88b354f02281b191512bf33b27ee36dc5d2 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Wed, 25 May 2022 12:55:42 +0200 Subject: [PATCH] Do not use ternary "if" for logger format string Using ternary "if"s with logging macros forbids using simple augmentation with file name and/or line number, e.g.: #define ChipLogError(MOD, MSG, ...) \ ::Log(MOD, "%s:%d " MSG, __FILE__, __LINE__, ##__VA_ARGS__) --- src/platform/Tizen/BLEManagerImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index f45e1e579d1359..b30b8ec876ad6b 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -79,7 +79,7 @@ void BLEManagerImpl::GattConnectionStateChangedCb(int result, bool connected, co if (result != BT_ERROR_NONE) { - ChipLogError(DeviceLayer, connected ? "Connection req failed" : "Disconnection req failed"); + ChipLogError(DeviceLayer, "%s", connected ? "Connection req failed" : "Disconnection req failed"); if (connected) sInstance.NotifyHandleConnectFailed(CHIP_ERROR_INTERNAL); }