Browse Source

Added stdout logging in debug mode. Moved android logging code.

doc_update_sequoia
Edouard Tisserant 5 years ago
parent
commit
99fc922a19
2 changed files with 8 additions and 12 deletions
  1. +0
    -6
      src/pEpEngine.c
  2. +8
    -6
      src/pEp_internal.h

+ 0
- 6
src/pEpEngine.c View File

@ -786,12 +786,6 @@ DYNAMIC_API PEP_STATUS log_event(
assert(title);
assert(entity);
#ifndef NDEBUG
#ifdef ANDROID
LOGD(" %s :: %s :: %s ", title, entity, description);
#endif
#endif
if (!(session && title && entity))
return PEP_ILLEGAL_VALUE;


+ 8
- 6
src/pEp_internal.h View File

@ -169,16 +169,18 @@ void release_transport_system(PEP_SESSION session, bool out_last);
#ifdef NDEBUG
#define DEBUG_LOG(TITLE, ENTITY, DESC)
#define LOGD(...)
#else
#define DEBUG_LOG(TITLE, ENTITY, DESC) \
log_event(session, (TITLE), (ENTITY), (DESC), "debug");
#ifdef ANDROID
#include <android/log.h>
#define LOG_TAG "pEpEngine"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOG_MORE(...) __android_log_print(ANDROID_LOG_DEBUG, "pEpEngine", " %s :: %s :: %s ", __VA_ARGS__);
#else
#include <stdio.h>
#define LOG_MORE(...) printf("pEpEngine DEBUG_LOG('%s','%s','%s')\n", __VA_ARGS__);
#endif
#define DEBUG_LOG(TITLE, ENTITY, DESC) {\
log_event(session, (TITLE), (ENTITY), (DESC), "debug");\
LOG_MORE((TITLE), (ENTITY), (DESC))\
}
#endif
// Space tolerant and case insensitive fingerprint string compare


Loading…
Cancel
Save