mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-09 20:59:03 +00:00
HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.
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>
This commit is contained in:
48
misc/tools/acrn-crashlog/common/include/log_sys.h
Normal file
48
misc/tools/acrn-crashlog/common/include/log_sys.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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
|
Reference in New Issue
Block a user