mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-31 03:15:42 +00:00
This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build Tracked-On: #3482 Signed-off-by: Terry Zou <terry.zou@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
49 lines
972 B
C
49 lines
972 B
C
/*
|
|
* Copyright (C) <2018> Intel Corporation
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef __LOG_SYS_H__
|
|
#define __LOG_SYS_H__
|
|
|
|
#include <syslog.h>
|
|
#include <systemd/sd-journal.h>
|
|
|
|
void debug_log(int level, const char *func, int line, ...);
|
|
|
|
#define LOG_LEVEL LOG_WARNING
|
|
|
|
#ifdef DEBUG_ACRN_CRASHLOG
|
|
#define LOGE(...) \
|
|
debug_log(LOG_ERR, __func__, __LINE__, __VA_ARGS__)
|
|
|
|
#define LOGW(...) \
|
|
debug_log(LOG_WARNING, __func__, __LINE__, __VA_ARGS__)
|
|
|
|
#define LOGI(...) \
|
|
debug_log(LOG_INFO, __func__, __LINE__, __VA_ARGS__)
|
|
|
|
#define LOGD(...) \
|
|
debug_log(LOG_DEBUG, __func__, __LINE__, __VA_ARGS__)
|
|
#else
|
|
#define ac_log(level, ...) \
|
|
do { \
|
|
if (level <= LOG_LEVEL) \
|
|
sd_journal_print(level, __VA_ARGS__); \
|
|
} while (0)
|
|
|
|
#define LOGE(...) \
|
|
ac_log(LOG_ERR, __VA_ARGS__)
|
|
|
|
#define LOGW(...) \
|
|
ac_log(LOG_WARNING, __VA_ARGS__)
|
|
|
|
#define LOGI(...) \
|
|
ac_log(LOG_INFO, __VA_ARGS__)
|
|
|
|
#define LOGD(...) \
|
|
ac_log(LOG_DEBUG, __VA_ARGS__)
|
|
#endif
|
|
|
|
#endif
|