From e9a6e6a8a9d7e8023fe0a7b3275fb857a66ff507 Mon Sep 17 00:00:00 2001 From: liuyifei Date: Thu, 19 Dec 2024 01:58:13 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E9=87=8A=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyifei --- .../native/innerkits/include/hilog/log_cpp.h | 23 +++++----- .../native/innerkits/include/hilog_trace.h | 44 +++++++++---------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/interfaces/native/innerkits/include/hilog/log_cpp.h b/interfaces/native/innerkits/include/hilog/log_cpp.h index 76c9543..1077e20 100644 --- a/interfaces/native/innerkits/include/hilog/log_cpp.h +++ b/interfaces/native/innerkits/include/hilog/log_cpp.h @@ -34,19 +34,20 @@ using HiLogLabel = struct { const char *tag; }; -/** - * @brief Hilog C++ class interface of different log level. - * Debug: Designates lower priority log. - * Info: Designates useful information. - * Warn: Designates hazardous situations. - * Error: Designates very serious errors. - * Fatal: Designates major fatal anomaly. - * - * @param label HiLogLabel for the log - * @param fmt Format string for the log - */ + class HiLog final { public: + /** + * @brief Hilog C++ class interface of different log level. + * Debug: Designates lower priority log. + * Info: Designates useful information. + * Warn: Designates hazardous situations. + * Error: Designates very serious errors. + * Fatal: Designates major fatal anomaly. + * + * @param label HiLogLabel for the log + * @param fmt Format string for the log + */ static int Debug(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(os_log, 2, 3))); static int Info(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(os_log, 2, 3))); static int Warn(const HiLogLabel &label, const char *fmt, ...) __attribute__((__format__(os_log, 2, 3))); diff --git a/interfaces/native/innerkits/include/hilog_trace.h b/interfaces/native/innerkits/include/hilog_trace.h index b370c93..1e004c3 100644 --- a/interfaces/native/innerkits/include/hilog_trace.h +++ b/interfaces/native/innerkits/include/hilog_trace.h @@ -12,34 +12,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifndef HIVIEWDFX_HILOG_TRACE_H -#define HIVIEWDFX_HILOG_TRACE_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int (*RegisterFunc)(uint64_t*, uint32_t*, uint64_t*, uint64_t*); - + +#ifndef HIVIEWDFX_HILOG_TRACE_H +#define HIVIEWDFX_HILOG_TRACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int (*RegisterFunc)(uint64_t*, uint32_t*, uint64_t*, uint64_t*); + /** * @brief register hilog trace. * - * @param RegisterFunc Function pointer to RegisterFunc + * @param func Function pointer to RegisterFunc */ -int HiLogRegisterGetIdFun(RegisterFunc); +int HiLogRegisterGetIdFun(RegisterFunc func); /** * @brief unregister hilog trace. * - * @param RegisterFunc Function pointer to RegisterFunc + * @param func Function pointer to RegisterFunc */ -void HiLogUnregisterGetIdFun(RegisterFunc); - -#ifdef __cplusplus -} -#endif - -#endif // HIVIEWDFX_HILOG_TRACE_H +void HiLogUnregisterGetIdFun(RegisterFunc func); + +#ifdef __cplusplus +} +#endif + +#endif // HIVIEWDFX_HILOG_TRACE_H -- Gitee