Вопрос

How can I easily replace the log4cxx for android log?

I'm trying to re-define as:

#define LOG4CXX_INFO(logger, message) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, message)

But a compilation error is showed:

xxxxx.cpp:122:13: error: no match for 'operator<<' in '"Could not open file " << fileName'
Это было полезно?

Решение

It is best to write a custom Appender wrapping __android_log_print.

See Log4cxx custom appender.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top