You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.3 KiB
69 lines
1.3 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2012-2019. All rights reserved.
|
|
* Description:
|
|
* Author:
|
|
* Create:
|
|
*/
|
|
|
|
#ifndef MWLOGTOOL_H
|
|
#define MWLOGTOOL_H
|
|
|
|
#ifndef LOG_TAG
|
|
#define LOG_TAG NULL
|
|
#endif
|
|
|
|
enum ATV_LOG_PRIO_E {
|
|
ATV_LOG_UNKNOWN = 0,
|
|
ATV_LOG_DEFAULT,
|
|
ATV_LOG_VERBOSE,
|
|
ATV_LOG_DEBUG,
|
|
ATV_LOG_INFO,
|
|
ATV_LOG_WARN,
|
|
ATV_LOG_ERROR,
|
|
ATV_LOG_FATAL,
|
|
ATV_LOG_BUTT,
|
|
};
|
|
|
|
#ifndef TLOGE
|
|
#define TLOGE(...) \
|
|
tool_printLog(ATV_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
|
#endif
|
|
|
|
#ifndef TLOGW
|
|
#define TLOGW(...) \
|
|
tool_printLog(ATV_LOG_WARN, LOG_TAG, __VA_ARGS__)
|
|
#endif
|
|
|
|
#ifndef TLOGI
|
|
#define TLOGI(...) \
|
|
tool_printLog(ATV_LOG_INFO, LOG_TAG, __VA_ARGS__)
|
|
#endif
|
|
|
|
#ifndef TLOGD
|
|
#define TLOGD(...) \
|
|
tool_printLog(ATV_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
|
#endif
|
|
|
|
#ifndef TLOGV
|
|
#define TLOGV(...) \
|
|
tool_printLog(ATV_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
|
|
#endif
|
|
|
|
#define tool_printLog(prio, tag, fmt...) \
|
|
MwLogTool::PrintLog(prio, tag, __FUNCTION__, __LINE__, fmt)
|
|
|
|
namespace android {
|
|
/* 此类用于客户端client的打印等级开关同步server的等级 */
|
|
class MwLogTool {
|
|
public:
|
|
static int PrintLog(ATV_LOG_PRIO_E prio, const char *tag, const char *func, unsigned int line,
|
|
const char *fmt, ...);
|
|
|
|
private:
|
|
static int getLogLevel();
|
|
|
|
static int level;
|
|
};
|
|
}
|
|
#endif
|