Maximum logging verbosity even if not in DEBUG - for diphoton branch only. test_diphoton
authorEdouard Tisserant <edouard@pep-project.org>
Fri, 02 Jun 2017 11:55:04 +0200
branchtest_diphoton
changeset 1816dc9bc5fa3f18
parent 1804 775bb90eccd5
child 1860 1975a3b9bc37
Maximum logging verbosity even if not in DEBUG - for diphoton branch only.
src/pEp_internal.h
sync/gen_statemachine.ysl2
sync/generated/sync_fsm.c
     1.1 --- a/src/pEp_internal.h	Wed May 24 15:19:41 2017 +0200
     1.2 +++ b/src/pEp_internal.h	Fri Jun 02 11:55:04 2017 +0200
     1.3 @@ -173,9 +173,9 @@
     1.4          size_t psize, char **ctext, size_t *csize
     1.5  );
     1.6  
     1.7 -#ifdef NDEBUG
     1.8 -#define DEBUG_LOG(TITLE, ENTITY, DESC)
     1.9 -#else
    1.10 +// #ifdef NDEBUG
    1.11 +// #define DEBUG_LOG(TITLE, ENTITY, DESC)
    1.12 +// #else
    1.13  #ifdef ANDROID
    1.14  #include <android/log.h>
    1.15  #define  LOG_MORE(...)  __android_log_print(ANDROID_LOG_DEBUG, "pEpEngine", " %s :: %s :: %s ", __VA_ARGS__);
    1.16 @@ -187,7 +187,7 @@
    1.17      log_event(session, (TITLE), (ENTITY), (DESC), "debug");\
    1.18      LOG_MORE((TITLE), (ENTITY), (DESC))\
    1.19  }
    1.20 -#endif
    1.21 +// #endif
    1.22  
    1.23  typedef enum _normalize_hex_rest_t {
    1.24      accept_hex,
     2.1 --- a/sync/gen_statemachine.ysl2	Wed May 24 15:19:41 2017 +0200
     2.2 +++ b/sync/gen_statemachine.ysl2	Fri Jun 02 11:55:04 2017 +0200
     2.3 @@ -339,10 +339,10 @@
     2.4      template "condition" {
     2.5          | {
     2.6          |> int cond_result = «@name»(session`apply "parm", 0`);
     2.7 -        |> #ifndef NDEBUG
     2.8 +        |> // #ifndef NDEBUG
     2.9          |> char resstr[11] = {0,};
    2.10          |> snprintf(resstr,10,"result=%d",cond_result);
    2.11 -        |> #endif
    2.12 +        |> // #endif
    2.13          |> DEBUG_LOG("FSM condition", "«ancestor::fsm/@filename»_fsm.c, state=«ancestor::state/@name», event=«ancestor::event/@name», condition=«@name»", resstr)
    2.14          |> if (cond_result < 0)
    2.15          |>> return cond_result;
     3.1 --- a/sync/generated/sync_fsm.c	Wed May 24 15:19:41 2017 +0200
     3.2 +++ b/sync/generated/sync_fsm.c	Fri Jun 02 11:55:04 2017 +0200
     3.3 @@ -46,10 +46,10 @@
     3.4                      *timeout = 0;
     3.5                      {
     3.6                          int cond_result = deviceGrouped(session);
     3.7 -                        #ifndef NDEBUG
     3.8 +                        // #ifndef NDEBUG
     3.9                          char resstr[11] = {0,};
    3.10                          snprintf(resstr,10,"result=%d",cond_result);
    3.11 -                        #endif
    3.12 +                        // #endif
    3.13                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=InitState, event=Init, condition=deviceGrouped", resstr)
    3.14                          if (cond_result < 0)
    3.15                              return cond_result;
    3.16 @@ -284,10 +284,10 @@
    3.17                      DEBUG_LOG("FSM event", "sync_fsm.c, state=SoleBeaconed", "event=HandshakeRequest")
    3.18                      {
    3.19                          int cond_result = sameIdentities(session, partner, expected);
    3.20 -                        #ifndef NDEBUG
    3.21 +                        // #ifndef NDEBUG
    3.22                          char resstr[11] = {0,};
    3.23                          snprintf(resstr,10,"result=%d",cond_result);
    3.24 -                        #endif
    3.25 +                        // #endif
    3.26                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=SoleBeaconed, event=HandshakeRequest, condition=sameIdentities", resstr)
    3.27                          if (cond_result < 0)
    3.28                              return cond_result;
    3.29 @@ -344,10 +344,10 @@
    3.30                      *timeout = 600;
    3.31                      {
    3.32                          int cond_result = keyElectionWon(session, expected);
    3.33 -                        #ifndef NDEBUG
    3.34 +                        // #ifndef NDEBUG
    3.35                          char resstr[11] = {0,};
    3.36                          snprintf(resstr,10,"result=%d",cond_result);
    3.37 -                        #endif
    3.38 +                        // #endif
    3.39                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=HandshakingSole, event=Init, condition=keyElectionWon", resstr)
    3.40                          if (cond_result < 0)
    3.41                              return cond_result;
    3.42 @@ -392,10 +392,10 @@
    3.43                      DEBUG_LOG("FSM event", "sync_fsm.c, state=HandshakingSole", "event=HandshakeAccepted")
    3.44                      {
    3.45                          int cond_result = sameIdentities(session, partner, expected);
    3.46 -                        #ifndef NDEBUG
    3.47 +                        // #ifndef NDEBUG
    3.48                          char resstr[11] = {0,};
    3.49                          snprintf(resstr,10,"result=%d",cond_result);
    3.50 -                        #endif
    3.51 +                        // #endif
    3.52                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=HandshakingSole, event=HandshakeAccepted, condition=sameIdentities", resstr)
    3.53                          if (cond_result < 0)
    3.54                              return cond_result;
    3.55 @@ -408,10 +408,10 @@
    3.56                              return (int) invalid_action;
    3.57                          {
    3.58                              int cond_result = keyElectionWon(session, partner);
    3.59 -                            #ifndef NDEBUG
    3.60 +                            // #ifndef NDEBUG
    3.61                              char resstr[11] = {0,};
    3.62                              snprintf(resstr,10,"result=%d",cond_result);
    3.63 -                            #endif
    3.64 +                            // #endif
    3.65                              DEBUG_LOG("FSM condition", "sync_fsm.c, state=HandshakingSole, event=HandshakeAccepted, condition=keyElectionWon", resstr)
    3.66                              if (cond_result < 0)
    3.67                                  return cond_result;
    3.68 @@ -488,10 +488,10 @@
    3.69                      group_keys_extra_t* groupkeys = (group_keys_extra_t*)extra;
    3.70                      {
    3.71                          int cond_result = keyElectionWon(session, expected);
    3.72 -                        #ifndef NDEBUG
    3.73 +                        // #ifndef NDEBUG
    3.74                          char resstr[11] = {0,};
    3.75                          snprintf(resstr,10,"result=%d",cond_result);
    3.76 -                        #endif
    3.77 +                        // #endif
    3.78                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=HandshakingSole, event=GroupKeys, condition=keyElectionWon", resstr)
    3.79                          if (cond_result < 0)
    3.80                              return cond_result;
    3.81 @@ -500,10 +500,10 @@
    3.82                          else {
    3.83                          {
    3.84                              int cond_result = sameKeyAndAddress(session, partner, expected);
    3.85 -                            #ifndef NDEBUG
    3.86 +                            // #ifndef NDEBUG
    3.87                              char resstr[11] = {0,};
    3.88                              snprintf(resstr,10,"result=%d",cond_result);
    3.89 -                            #endif
    3.90 +                            // #endif
    3.91                              DEBUG_LOG("FSM condition", "sync_fsm.c, state=HandshakingSole, event=GroupKeys, condition=sameKeyAndAddress", resstr)
    3.92                              if (cond_result < 0)
    3.93                                  return cond_result;
    3.94 @@ -573,10 +573,10 @@
    3.95                      group_keys_extra_t* groupkeys = (group_keys_extra_t*)extra;
    3.96                      {
    3.97                          int cond_result = sameKeyAndAddress(session, partner, expected);
    3.98 -                        #ifndef NDEBUG
    3.99 +                        // #ifndef NDEBUG
   3.100                          char resstr[11] = {0,};
   3.101                          snprintf(resstr,10,"result=%d",cond_result);
   3.102 -                        #endif
   3.103 +                        // #endif
   3.104                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=WaitForGroupKeysSole, event=GroupKeys, condition=sameKeyAndAddress", resstr)
   3.105                          if (cond_result < 0)
   3.106                              return cond_result;
   3.107 @@ -673,10 +673,10 @@
   3.108                      DEBUG_LOG("FSM event", "sync_fsm.c, state=WaitForAcceptSole", "event=HandshakeAccepted")
   3.109                      {
   3.110                          int cond_result = sameKeyAndAddress(session, partner, expected);
   3.111 -                        #ifndef NDEBUG
   3.112 +                        // #ifndef NDEBUG
   3.113                          char resstr[11] = {0,};
   3.114                          snprintf(resstr,10,"result=%d",cond_result);
   3.115 -                        #endif
   3.116 +                        // #endif
   3.117                          DEBUG_LOG("FSM condition", "sync_fsm.c, state=WaitForAcceptSole, event=HandshakeAccepted, condition=sameKeyAndAddress", resstr)
   3.118                          if (cond_result < 0)
   3.119                              return cond_result;