pjsua_logging_config log_cfg;
pjsua_logging_config_default(&log_cfg);
log_cfg.console_level = 4;
log_cfg.cb = &log_writer;
pjsua_init(&ua_cfg, &log_cfg, &media_cfg);
static void log_writer(int level, const char *data, int len){
__android_log_write(ANDROID_LOG_INFO, "pjsua", data);
}
在android studio上始终无法显示log信息。以为是PJSIP不支持android log显示。但是查看pjsua_logging_config结构,看到有void(* cb )(int level, const char *data, int len)。看到注释说是写入特定的设备,再一看这个参数信息怎么和__android_log_write一样啊!瞬间秒懂。。。