1 /*
2  * SPDX-License-Identifier: Apache-2.0
3  *
4  * Copyright (c) 2017 Linaro Limited
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 #ifndef H_BOOTUTIL_LOG_H_
20 #define H_BOOTUTIL_LOG_H_
21 
22 #include "ignore.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <mcuboot_config/mcuboot_config.h>
29 
30 #ifdef MCUBOOT_HAVE_LOGGING
31 #include <mcuboot_config/mcuboot_logging.h>
32 
33 #define BOOT_LOG_ERR(...) MCUBOOT_LOG_ERR(__VA_ARGS__)
34 #define BOOT_LOG_WRN(...) MCUBOOT_LOG_WRN(__VA_ARGS__)
35 #define BOOT_LOG_INF(...) MCUBOOT_LOG_INF(__VA_ARGS__)
36 #define BOOT_LOG_DBG(...) MCUBOOT_LOG_DBG(__VA_ARGS__)
37 #define BOOT_LOG_SIM(...) MCUBOOT_LOG_SIM(__VA_ARGS__)
38 
39 #define BOOT_LOG_MODULE_DECLARE(module)  MCUBOOT_LOG_MODULE_DECLARE(module)
40 #define BOOT_LOG_MODULE_REGISTER(module) MCUBOOT_LOG_MODULE_REGISTER(module)
41 
42 #else
43 
44 #define BOOT_LOG_ERR(...) IGNORE(__VA_ARGS__)
45 #define BOOT_LOG_WRN(...) IGNORE(__VA_ARGS__)
46 #define BOOT_LOG_INF(...) IGNORE(__VA_ARGS__)
47 #define BOOT_LOG_DBG(...) IGNORE(__VA_ARGS__)
48 #define BOOT_LOG_SIM(...) IGNORE(__VA_ARGS__)
49 
50 #define BOOT_LOG_MODULE_DECLARE(module)
51 #define BOOT_LOG_MODULE_REGISTER(module)
52 
53 #endif /* MCUBOOT_HAVE_LOGGING */
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif
60