Customization of NFD codebase to use native android logging
This task is to replace
core/logger-factory.hpp|cpp with machinery provided by Android.
This machinery should be enabled only when
ANDROID macro is present
#4 Updated by Junxiao Shi over 4 years ago
- Start date deleted (
Instead of adding Android stuff into NFD, can we:
--with-loggerparameter which points to a directory that contains customized logger (for Android or ns-3)
core/logger-factory.cppare not compiled and linked, but files of same name in the other directory is used
#5 Updated by Alex Afanasyev over 4 years ago
This wouldn't work. Most heavy processing is inside
core/logger.hpp and I see no way how this file can be customized without macros. We can add
--with-logger option, but this should enable specific conditional compilation. In ns-3 case,
logger-factory.hpp|cpp will become empty with trivial implementation of
logger.hpp, in case of android, I'm expecting
logger-factory stay the same and
logger.hpp have slightly different defines.
#8 Updated by Junxiao Shi over 4 years ago
Can we use something like:
#if ANDROID #include "nfd-android/core/logger.hpp" #elif NS3 #include "ndnsim/core/logger.hpp" #else // regular logger #endif
wscript so that
logger.cpp isn't compiled when not needed.
My point is: don't put Android or ns-3 code in NFD, but include them from outside.
#9 Updated by Alex Afanasyev over 4 years ago
Hmm.. I have a mixed feeling about this, but here is a slightly more universal approach:
#if defined(HAVE_CUSTOM_LOGGER) #include "custom-logger.hpp" #else ... regular logger #endif // defined(HAVE_CUSTOM_LOGGER)
This way we don't need targeted specializations, which can in both android and ndnSIM cases be done in the same way.