|
2 | 2 | * Copyright (c) 2017 Linaro Limited |
3 | 3 | * SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors |
4 | 4 | * |
| 5 | + * SPDX-License-Identifier: BSD-3-Clause |
| 6 | + * |
5 | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 8 | * you may not use this file except in compliance with the License. |
7 | 9 | * You may obtain a copy of the License at |
|
18 | 20 | #ifndef __MCUBOOT_LOGGING_H__ |
19 | 21 | #define __MCUBOOT_LOGGING_H__ |
20 | 22 |
|
21 | | -#include "bootutil/ignore.h" |
22 | | - |
23 | | -/* |
24 | | - * MCUBoot uses MCUBOOT_LOG_LEVEL to specify the log level |
25 | | - * but tfm_log.h requires the definition of LOG_LEVEL. Define |
26 | | - * the maximum possible LOG_LEVEL which ensures that all |
27 | | - * macros are valid. MCUBoot can then use its log level |
28 | | - * to determine what to log. |
29 | | - */ |
30 | | -#undef LOG_LEVEL |
31 | | -#define LOG_LEVEL LOG_LEVEL_VERBOSE |
32 | 23 | #include "tfm_log.h" |
33 | 24 |
|
34 | 25 | #ifdef __cplusplus |
35 | 26 | extern "C" { |
36 | 27 | #endif |
37 | 28 |
|
38 | | -#define MCUBOOT_LOG_LEVEL_OFF LOG_LEVEL_NONE |
39 | | -#define MCUBOOT_LOG_LEVEL_ERROR LOG_LEVEL_ERROR |
40 | | -#define MCUBOOT_LOG_LEVEL_WARNING LOG_LEVEL_WARNING |
41 | | -#define MCUBOOT_LOG_LEVEL_INFO LOG_LEVEL_INFO |
42 | | -#define MCUBOOT_LOG_LEVEL_DEBUG LOG_LEVEL_VERBOSE |
43 | | - |
44 | | -#ifndef MCUBOOT_LOG_LEVEL |
45 | | -#define MCUBOOT_LOG_LEVEL MCUBOOT_LOG_LEVEL_INFO |
46 | | -#endif |
47 | | - |
48 | 29 | #define MCUBOOT_LOG_MODULE_DECLARE(domain) /* Ignore */ |
49 | 30 | #define MCUBOOT_LOG_MODULE_REGISTER(domain) /* Ignore */ |
50 | 31 |
|
51 | | -#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_ERROR |
52 | | -#define MCUBOOT_LOG_ERR(_fmt, ...) \ |
53 | | - ERROR(_fmt "\n", ##__VA_ARGS__) |
54 | | -#else |
55 | | -#define MCUBOOT_LOG_ERR(...) IGNORE(__VA_ARGS__) |
56 | | -#endif |
| 32 | +#define MCUBOOT_LOG_ERR(_fmt, ...) ERROR(_fmt "\n", ##__VA_ARGS__) |
57 | 33 |
|
58 | | -#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_WARNING |
59 | | -#define MCUBOOT_LOG_WRN(_fmt, ...) \ |
60 | | - WARN(_fmt "\n", ##__VA_ARGS__) |
61 | | -#else |
62 | | -#define MCUBOOT_LOG_WRN(...) IGNORE(__VA_ARGS__) |
63 | | -#endif |
| 34 | +#define MCUBOOT_LOG_WRN(_fmt, ...) WARN(_fmt "\n", ##__VA_ARGS__) |
64 | 35 |
|
65 | | -#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_INFO |
66 | | -#define MCUBOOT_LOG_INF(_fmt, ...) \ |
67 | | - INFO(_fmt "\n", ##__VA_ARGS__) |
68 | | -#else |
69 | | -#define MCUBOOT_LOG_INF(...) IGNORE(__VA_ARGS__) |
70 | | -#endif |
| 36 | +#define MCUBOOT_LOG_INF(_fmt, ...) INFO(_fmt "\n", ##__VA_ARGS__) |
71 | 37 |
|
72 | | -#if MCUBOOT_LOG_LEVEL >= MCUBOOT_LOG_LEVEL_DEBUG |
73 | | -#define MCUBOOT_LOG_DBG(_fmt, ...) \ |
74 | | - VERBOSE(_fmt "\n", ##__VA_ARGS__) |
75 | | -#else |
76 | | -#define MCUBOOT_LOG_DBG(...) IGNORE(__VA_ARGS__) |
77 | | -#endif |
| 38 | +#define MCUBOOT_LOG_DBG(_fmt, ...) VERBOSE(_fmt "\n", ##__VA_ARGS__) |
78 | 39 |
|
79 | 40 | #ifdef __cplusplus |
80 | 41 | } |
|
0 commit comments