初始化版本

This commit is contained in:
冯佳
2026-02-09 10:27:21 +08:00
commit 64d767932f
4467 changed files with 2486822 additions and 0 deletions

44
osal/include/osal_log.h Normal file
View File

@ -0,0 +1,44 @@
#ifndef __OSAL_LOG_H__
#define __OSAL_LOG_H__
#include "osal_def.h"
#include "osal_config.h"
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Log API */
void osal_kprintf(const char *fmt, ...);
/* Log Macros */
#if (OSAL_LOG_LEVEL >= OSAL_LOG_LEVEL_ERROR)
#define osal_log_e(fmt, ...) osal_kprintf("[Error] " fmt "\n", ##__VA_ARGS__)
#else
#define osal_log_e(fmt, ...)
#endif
#if (OSAL_LOG_LEVEL >= OSAL_LOG_LEVEL_WARN)
#define osal_log_w(fmt, ...) osal_kprintf("[Warning] " fmt "\n", ##__VA_ARGS__)
#else
#define osal_log_w(fmt, ...)
#endif
#if (OSAL_LOG_LEVEL >= OSAL_LOG_LEVEL_INFO)
#define osal_log_i(fmt, ...) osal_kprintf("[Info] " fmt "\n", ##__VA_ARGS__)
#else
#define osal_log_i(fmt, ...)
#endif
#if (OSAL_LOG_LEVEL >= OSAL_LOG_LEVEL_DEBUG)
#define osal_log_d(fmt, ...) osal_kprintf("[Debug] " fmt "\n", ##__VA_ARGS__)
#else
#define osal_log_d(fmt, ...)
#endif
#ifdef __cplusplus
}
#endif
#endif /* __OSAL_LOG_H__ */