fix issue from internal review

Signed-off-by: shenchenkai <shenchenkai@huawei.com>
This commit is contained in:
shenchenkai
2022-03-23 09:00:18 +00:00
committed by Gitee
parent a32e3d3600
commit b72e9a5217
2 changed files with 71 additions and 1 deletions
+1 -1
View File
@@ -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