change name

Signed-off-by: mtf <matengfei19@huawei.com>
Change-Id: I301b81af59e658058f4d96a0d1025e5e4d8b7ed2
This commit is contained in:
mtf 2022-05-09 10:08:26 +08:00
parent e30e7cf4d2
commit b5a67c03ad

View File

@ -21,16 +21,16 @@ namespace OHOS {
namespace UserIAM {
namespace Common {
#ifdef __FILE_NAME__
#define FILE __FILE_NAME__
#define IAM_LOG_FILE __FILE_NAME__
#else
#define FILE (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
#define IAM_LOG_FILE (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
#endif
#ifdef LOG_LABEL
#undef LOG_LABEL
#endif
#define ARGS(fmt, ...) "[%{public}s@%{public}s:%{public}d] " fmt, __FUNCTION__, FILE, __LINE__, ##__VA_ARGS__
#define ARGS(fmt, ...) "[%{public}s@%{public}s:%{public}d] " fmt, __FUNCTION__, IAM_LOG_FILE, __LINE__, ##__VA_ARGS__
#define IAM_LOGD(...) OHOS::HiviewDFX::HiLog::Debug(LOG_LABEL, ARGS(__VA_ARGS__))
#define IAM_LOGI(...) OHOS::HiviewDFX::HiLog::Info(LOG_LABEL, ARGS(__VA_ARGS__))
#define IAM_LOGW(...) OHOS::HiviewDFX::HiLog::Warn(LOG_LABEL, ARGS(__VA_ARGS__))