From 3db75ab31f0b5ce801053864c6387c8bdda31b9d Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 21 Sep 2017 08:47:37 -0700 Subject: [PATCH] [config] simplify the log output selection (#2206) This commits simplifies the log output selection by having posix and windows use the common `CONFIG_LOG_OUTPUT_PLATFORM_DEFINED`. --- examples/platforms/posix/logging.c | 4 ++-- examples/platforms/posix/openthread-core-posix-config.h | 2 +- include/openthread-windows-config.h | 2 +- src/core/openthread-core-default-config.h | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/platforms/posix/logging.c b/examples/platforms/posix/logging.c index b906147ef..8fbb13cbe 100644 --- a/examples/platforms/posix/logging.c +++ b/examples/platforms/posix/logging.c @@ -54,7 +54,7 @@ otEXPECT_ACTION(offset < sizeof(logString), logString[sizeof(logString) -1 ] = 0) -#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_HOST_OS) || (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) +#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) { char logString[512]; @@ -83,4 +83,4 @@ exit: (void)aLogRegion; } -#endif +#endif // #if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) diff --git a/examples/platforms/posix/openthread-core-posix-config.h b/examples/platforms/posix/openthread-core-posix-config.h index a30bed1c2..0566539b1 100644 --- a/examples/platforms/posix/openthread-core-posix-config.h +++ b/examples/platforms/posix/openthread-core-posix-config.h @@ -50,7 +50,7 @@ * */ #ifndef OPENTHREAD_CONFIG_LOG_OUTPUT /* allow command line override */ -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_HOST_OS +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED #endif /** diff --git a/include/openthread-windows-config.h b/include/openthread-windows-config.h index 980c486f6..1a42d2912 100644 --- a/include/openthread-windows-config.h +++ b/include/openthread-windows-config.h @@ -37,7 +37,7 @@ #define OPENTHREAD_ENABLE_MULTIPLE_INSTANCES 1 /* Define to 1 if you want to enable default log output. */ -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_HOST_OS +#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED /* Define to 1 to enable the commissioner role. */ #define OPENTHREAD_ENABLE_COMMISSIONER 1 diff --git a/src/core/openthread-core-default-config.h b/src/core/openthread-core-default-config.h index 1e99163dc..ac376548c 100644 --- a/src/core/openthread-core-default-config.h +++ b/src/core/openthread-core-default-config.h @@ -506,10 +506,8 @@ #define OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART 1 /** Log output goes to the "application" provided otPlatLog() in NCP and CLI code */ #define OPENTHREAD_CONFIG_LOG_OUTPUT_APP 2 -/** Log output goes to POSIX and WIN32 logging schemes */ -#define OPENTHREAD_CONFIG_LOG_OUTPUT_HOST_OS 3 /** Log output is handled by a platform defined function */ -#define OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED 4 +#define OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED 3 /** * @def OPENTHREAD_CONFIG_LOG_LEVEL