Skip to content

Commit

Permalink
Fixed logs for Darwin platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kkasperczyk-no committed Jan 2, 2023
1 parent b22a0c5 commit 3b728ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/lib/support/logging/CHIPLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ DLL_LOCAL inline bool IsCategoryEnabled(uint8_t category)
#endif // CHIP_LOG_FILTERING

/* Internal macros mapping upper case definitions to camel case category constants*/
#define _CHIP_LOG_CATEGORY_DETAIL chip::Logging::kLogCategory_Detail
#define _CHIP_LOG_CATEGORY_PROGRESS chip::Logging::kLogCategory_Progress
#define _CHIP_LOG_CATEGORY_ERROR chip::Logging::kLogCategory_Error
#define _CHIP_LOG_CATEGORY_AUTOMATION chip::Logging::kLogCategory_Automation
#define CHIP_LOG_CATEGORY_DETAIL chip::Logging::kLogCategory_Detail
#define CHIP_LOG_CATEGORY_PROGRESS chip::Logging::kLogCategory_Progress
#define CHIP_LOG_CATEGORY_ERROR chip::Logging::kLogCategory_Error
#define CHIP_LOG_CATEGORY_AUTOMATION chip::Logging::kLogCategory_Automation

/*
* CHIP Logging Modules Categories filtering implementation.
Expand Down Expand Up @@ -412,13 +412,13 @@ DLL_LOCAL void LogV(uint8_t module, uint8_t category, const char * msg, va_list
#define ChipInternalLog(MOD, CAT, MSG, ...) \
if (CHIP_CONFIG_LOG_MODULE_##MOD && IsModuleCategoryEnabled(MOD, CAT)) \
{ \
ChipInternalLogImpl(MOD, _CHIP_LOG_CATEGORY_##CAT, MSG, ##__VA_ARGS__); \
ChipInternalLogImpl(MOD, CHIP_LOG_CATEGORY_##CAT, MSG, ##__VA_ARGS__); \
}

#define ChipInternalLogByteSpan(MOD, CAT, DATA) \
if (CHIP_CONFIG_LOG_MODULE_##MOD && IsModuleCategoryEnabled(MOD, CAT)) \
{ \
ChipInternalLogByteSpanImpl(MOD, _CHIP_LOG_CATEGORY_##CAT, DATA); \
ChipInternalLogByteSpanImpl(MOD, CHIP_LOG_CATEGORY_##CAT, DATA); \
}
#endif // CHIP_SYSTEM_CONFIG_PLATFORM_LOG

Expand Down
4 changes: 2 additions & 2 deletions src/platform/Darwin/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
_Pragma("clang diagnostic ignored \"-Wformat\""); \
os_log_with_type(chip::Logging::Platform::LoggerForModule(chip::Logging::kLogModule_##MOD, #MOD), \
static_cast<os_log_type_t>(chip::Logging::Platform::kOSLogCategory_##CAT), MSG, ##__VA_ARGS__); \
ChipInternalLogImpl(MOD, CAT, MSG, ##__VA_ARGS__); \
ChipInternalLogImpl(MOD, CHIP_LOG_CATEGORY_##CAT, MSG, ##__VA_ARGS__); \
_Pragma("clang diagnostic pop"); \
} while (0)

Expand All @@ -43,7 +43,7 @@
{ \
chip::Logging::Platform::LogByteSpan(chip::Logging::kLogModule_##MOD, #MOD, \
static_cast<os_log_type_t>(chip::Logging::Platform::kOSLogCategory_##CAT), DATA); \
ChipInternalLogByteSpanImpl(MOD, CAT, DATA); \
ChipInternalLogByteSpanImpl(MOD, CHIP_LOG_CATEGORY_##CAT, DATA); \
} while (0)

namespace chip {
Expand Down

0 comments on commit 3b728ce

Please sign in to comment.