HarmonyOS真机调试C的代码使用OH\_LOG\_DEBUG输入日志,发现在C里面有些方法可以打印,有些方法完全不打印日志请问是什么情况,该如何解决。如下面的简易代码:
在C++的接口方法里面调用Sms4DecryptMsg方法进入和返回会打印日志,但是Sms4DecryptMsg方法里面是一个日志都不打印。
OH_LOG_DEBUG(LOG_APP, "Sms4DecryptMsg %{private}s, reason:%{public}d.", tmp, tmp);
nRet = Sms4DecryptMsg(mode, IV, ucKey, ulKeyLen, cinput, LenInput, ucPlain, &LenDecdata);
OH_LOG_DEBUG(LOG_APP, "Sms4DecryptMsgsss %{private}s, reason:%{public}d.", nRet, nRet);
int Sms4DecryptMsg(int mode, unsigned char *IV, unsigned char *skey, int iLenKey, unsigned char *cipher,
ULONG cipherlen, unsigned char *plain, ULONG *plainlen) {
OH_LOG_DEBUG(LOG_APP, "mode %{public}s, mode:%{public}d.", mode, mode);
OH_LOG_DEBUG(LOG_APP, "Sms4DecryptMsg************111");
int count = 0, i = 0, ret = 0;
HarmonyOS中建议使用HiLog,使用指南:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/hilog-guidelines-ndk-V5