1 /****************************************************************************
2  * boot/nuttx/include/mcuboot_config/mcuboot_logging.h
3  *
4  * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  ****************************************************************************/
19 
20 #ifndef __BOOT_NUTTX_INCLUDE_MCUBOOT_CONFIG_MCUBOOT_LOGGING_H
21 #define __BOOT_NUTTX_INCLUDE_MCUBOOT_CONFIG_MCUBOOT_LOGGING_H
22 
23 /****************************************************************************
24  * Included Files
25  ****************************************************************************/
26 
27 #include <syslog.h>
28 
29 /****************************************************************************
30  * Pre-processor Definitions
31  ****************************************************************************/
32 
33 #define MCUBOOT_LOG_MODULE_DECLARE(...)
34 #define MCUBOOT_LOG_MODULE_REGISTER(...)
35 
36 #define MCUBOOT_LOG_ERR(format, ...) \
37     syslog(LOG_ERR, "%s: " format "\n", __FUNCTION__, ##__VA_ARGS__)
38 
39 #define MCUBOOT_LOG_WRN(format, ...) \
40     syslog(LOG_WARNING, "%s: " format "\n", __FUNCTION__, ##__VA_ARGS__)
41 
42 #define MCUBOOT_LOG_INF(format, ...) \
43     syslog(LOG_INFO, "%s: " format "\n", __FUNCTION__, ##__VA_ARGS__)
44 
45 #define MCUBOOT_LOG_DBG(format, ...) \
46     syslog(LOG_DEBUG, "%s: " format "\n", __FUNCTION__, ##__VA_ARGS__)
47 
48 #endif /* __BOOT_NUTTX_INCLUDE_MCUBOOT_CONFIG_MCUBOOT_LOGGING_H */
49