I like that proposal Gabriel...

Do you have access to our Git repo?  If so, I'd love to see a patch to
make that a cleaner inclusion.

On Wed, 2015-08-05 at 14:00 +0300, Schulhof, Gabriel wrote:
> Hey, all!
> 
> I believe the modification below addresses the problem of building
> against the headers without having to provide paths to the logging
> headers, although, ideally, the logging should be moved to a separate
> header file, which should only be included where needed. From
> 
> find -type f | grep -vE '(\.git|out)' | awk '{ printf ( $0 "\0" ); }'
> | xargs -0 grep -niH '#include "ocpayload\.h"' | awk -F ':' '{ print
> $1; }' | sort -u | xargs grep -niH OC_LOG_PAYLOAD | awk -F ':' '{
> print $1;}' | sort -u
> 
> it seems that, aside from occollection.c, OC_LOG_PAYLOAD is only
> needed in the samples. So, perhaps, this logging should be moved to a
> header file referred only from the samples instead.
> 
> HTH,
> 
> 
> 
> Gabriel
> 
> commit acd5f72abba0982a002bfc3b226de4d20f055162
> Author: Gabriel Schulhof <gabriel.schulhof at intel.com>
> Date:   Wed Aug 5 13:47:53 2015 +0300
> 
>     CSDK: Only include logging.h if TB_LOG is defined
> 
> diff --git a/resource/csdk/stack/include/ocpayload.h
> b/resource/csdk/stack/include/ocpayload.h
> index 91776c4..b2487dd 100644
> --- a/resource/csdk/stack/include/ocpayload.h
> +++ b/resource/csdk/stack/include/ocpayload.h
> @@ -23,7 +23,6 @@
> 
>  #include <stdbool.h>
>  #include <inttypes.h>
> -#include "logger.h"
>  #include "octypes.h"
> 
>  #ifdef __cplusplus
> @@ -34,6 +33,7 @@ extern "C"
>  typedef struct OCResource OCResource;
> 
>  #ifdef TB_LOG
> +#include "logger.h"
>      #define OC_LOG_PAYLOAD(level, tag, payload)
> OCPayloadLog((level),(tag),(payload))
>      #define UUID_SIZE (16)
>      #define UUID_LENGTH (37)
> _______________________________________________
> iotivity-dev mailing list
> iotivity-dev at lists.iotivity.org
> https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to