Added stdout logging in debug mode. Moved android logging code. AllGroupDevicesShowHandshake
authorEdouard Tisserant <edouard@pep-project.org>
Tue, 07 Mar 2017 23:52:44 +0100
branchAllGroupDevicesShowHandshake
changeset 1630a507a5006bea
parent 1629 17468e906343
child 1631 f7eb7c5aadb8
child 1632 ab9a7a180cfe
Added stdout logging in debug mode. Moved android logging code.
src/pEpEngine.c
src/pEp_internal.h
     1.1 --- a/src/pEpEngine.c	Tue Mar 07 23:18:59 2017 +0100
     1.2 +++ b/src/pEpEngine.c	Tue Mar 07 23:52:44 2017 +0100
     1.3 @@ -786,12 +786,6 @@
     1.4      assert(title);
     1.5      assert(entity);
     1.6  
     1.7 -    #ifndef NDEBUG
     1.8 -    #ifdef ANDROID
     1.9 -    LOGD(" %s :: %s :: %s ", title, entity, description);
    1.10 -    #endif
    1.11 -    #endif
    1.12 -
    1.13      if (!(session && title && entity))
    1.14          return PEP_ILLEGAL_VALUE;
    1.15  
     2.1 --- a/src/pEp_internal.h	Tue Mar 07 23:18:59 2017 +0100
     2.2 +++ b/src/pEp_internal.h	Tue Mar 07 23:52:44 2017 +0100
     2.3 @@ -169,16 +169,18 @@
     2.4  
     2.5  #ifdef NDEBUG
     2.6  #define DEBUG_LOG(TITLE, ENTITY, DESC)
     2.7 -#define  LOGD(...)
     2.8  #else
     2.9 -#define DEBUG_LOG(TITLE, ENTITY, DESC) \
    2.10 -    log_event(session, (TITLE), (ENTITY), (DESC), "debug");
    2.11  #ifdef ANDROID
    2.12  #include <android/log.h>
    2.13 -#define  LOG_TAG    "pEpEngine"
    2.14 -#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
    2.15 +#define  LOG_MORE(...)  __android_log_print(ANDROID_LOG_DEBUG, "pEpEngine", " %s :: %s :: %s ", __VA_ARGS__);
    2.16 +#else
    2.17 +#include <stdio.h>
    2.18 +#define  LOG_MORE(...)  printf("pEpEngine DEBUG_LOG('%s','%s','%s')\n", __VA_ARGS__);
    2.19  #endif
    2.20 -
    2.21 +#define DEBUG_LOG(TITLE, ENTITY, DESC) {\
    2.22 +    log_event(session, (TITLE), (ENTITY), (DESC), "debug");\
    2.23 +    LOG_MORE((TITLE), (ENTITY), (DESC))\
    2.24 +}
    2.25  #endif
    2.26  
    2.27  // Space tolerant and case insensitive fingerprint string compare