mirror of
https://github.com/openharmony/hiviewdfx_hilog_lite.git
synced 2026-07-01 06:41:57 -04:00
fix issue from internal review
Signed-off-by: shenchenkai <shenchenkai@huawei.com>
This commit is contained in:
@@ -132,7 +132,7 @@ int SetOutputLevel(char cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (SetLogLevel(level) == true) {
|
||||
if (SetLogLevel(level)) {
|
||||
printf("Set the log output level success.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,10 +30,80 @@ struct HiLogLabel {
|
||||
|
||||
class HiLog final {
|
||||
public:
|
||||
/**
|
||||
* @brief Outputs debug logs.
|
||||
*
|
||||
* @param label Indicates the log label.
|
||||
* @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the
|
||||
* privacy identifier. Specifically, {public} or {private} is added between the % character and the format specifier
|
||||
* in each parameter. \n
|
||||
* @param... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers
|
||||
* in the format string.
|
||||
* @return Returns <b>0</b> or a larger value if the operation is successful; returns a value smaller than <b>0</b>
|
||||
* otherwise.
|
||||
* @since 1.1
|
||||
* @version 1.0
|
||||
*/
|
||||
static int Debug(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(printf, 2, 3)));
|
||||
/**
|
||||
* @brief Outputs informational logs.
|
||||
*
|
||||
* @param label Indicates the log label.
|
||||
* @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the
|
||||
* privacy identifier. Specifically, {public} or {private} is added between the % character and the format specifier
|
||||
* in each parameter. \n
|
||||
* @param... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers
|
||||
* in the format string.
|
||||
* @return Returns <b>0</b> or a larger value if the operation is successful; returns a value smaller than <b>0</b>
|
||||
* otherwise.
|
||||
* @since 1.1
|
||||
* @version 1.0
|
||||
*/
|
||||
static int Info(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(printf, 2, 3)));
|
||||
/**
|
||||
* @brief Outputs warning logs.
|
||||
*
|
||||
* @param label Indicates the log label.
|
||||
* @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the
|
||||
* privacy identifier. Specifically, {public} or {private} is added between the % character and the format specifier
|
||||
* in each parameter. \n
|
||||
* @param... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers
|
||||
* in the format string.
|
||||
* @return Returns <b>0</b> or a larger value if the operation is successful; returns a value smaller than <b>0</b>
|
||||
* otherwise.
|
||||
* @since 1.1
|
||||
* @version 1.0
|
||||
*/
|
||||
static int Warn(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(printf, 2, 3)));
|
||||
/**
|
||||
* @brief Outputs error logs.
|
||||
*
|
||||
* @param label Indicates the log label.
|
||||
* @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the
|
||||
* privacy identifier. Specifically, {public} or {private} is added between the % character and the format specifier
|
||||
* in each parameter. \n
|
||||
* @param... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers
|
||||
* in the format string.
|
||||
* @return Returns <b>0</b> or a larger value if the operation is successful; returns a value smaller than <b>0</b>
|
||||
* otherwise.
|
||||
* @since 1.1
|
||||
* @version 1.0
|
||||
*/
|
||||
static int Error(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(printf, 2, 3)));
|
||||
/**
|
||||
* @brief Outputs fatal logs.
|
||||
*
|
||||
* @param label Indicates the log label.
|
||||
* @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the
|
||||
* privacy identifier. Specifically, {public} or {private} is added between the % character and the format specifier
|
||||
* in each parameter. \n
|
||||
* @param... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers
|
||||
* in the format string.
|
||||
* @return Returns <b>0</b> or a larger value if the operation is successful; returns a value smaller than <b>0</b>
|
||||
* otherwise.
|
||||
* @since 1.1
|
||||
* @version 1.0
|
||||
*/
|
||||
static int Fatal(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(printf, 2, 3)));
|
||||
};
|
||||
} // namespace HiviewDFX
|
||||
|
||||
Reference in New Issue
Block a user