Skip to content

Commit

Permalink
Do not use ternary "if" for logger format string
Browse files Browse the repository at this point in the history
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__)
  • Loading branch information
arkq committed May 25, 2022
1 parent 619fd7c commit a003d88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/Tizen/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a003d88

Please sign in to comment.