|
| 1 | +/* |
| 2 | + * coreMQTT v1.2.0 |
| 3 | + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * |
| 5 | + * Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 6 | + * this software and associated documentation files (the "Software"), to deal in |
| 7 | + * the Software without restriction, including without limitation the rights to |
| 8 | + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 9 | + * the Software, and to permit persons to whom the Software is furnished to do so, |
| 10 | + * subject to the following conditions: |
| 11 | + * |
| 12 | + * The above copyright notice and this permission notice shall be included in all |
| 13 | + * copies or substantial portions of the Software. |
| 14 | + * |
| 15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 17 | + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 18 | + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 19 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 20 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 | + */ |
| 22 | + |
| 23 | +/** |
| 24 | + * @file core_mqtt_default_logging.h |
| 25 | + * @brief This represents the default values for the logging macros for the MQTT |
| 26 | + * library. |
| 27 | + * |
| 28 | + * @note This file SHOULD NOT be modified. If custom values are needed for |
| 29 | + * any configuration macro, a core_mqtt_config.h file should be provided to |
| 30 | + * the MQTT library to override the default values defined in this file. |
| 31 | + * To use the custom config file, the MQTT_DO_NOT_USE_CUSTOM_CONFIG preprocessor |
| 32 | + * macro SHOULD NOT be set. |
| 33 | + */ |
| 34 | + |
| 35 | +#ifndef CORE_MQTT_DEFAULT_LOGGING_H_ |
| 36 | +#define CORE_MQTT_DEFAULT_LOGGING_H_ |
| 37 | + |
| 38 | +/* *INDENT-OFF* */ |
| 39 | +#ifdef __cplusplus |
| 40 | + extern "C" { |
| 41 | +#endif |
| 42 | +/* *INDENT-ON* */ |
| 43 | + |
| 44 | +/** |
| 45 | + * @brief Macro that is called in the MQTT library for logging "Error" level |
| 46 | + * messages. |
| 47 | + * |
| 48 | + * To enable error level logging in the MQTT library, this macro should be mapped to the |
| 49 | + * application-specific logging implementation that supports error logging. |
| 50 | + * |
| 51 | + * @note This logging macro is called in the MQTT library with parameters wrapped in |
| 52 | + * double parentheses to be ISO C89/C90 standard compliant. For a reference |
| 53 | + * POSIX implementation of the logging macros, refer to core_mqtt_config.h files, and the |
| 54 | + * logging-stack in demos folder of the |
| 55 | + * [AWS IoT Embedded C SDK repository](https://github.com/aws/aws-iot-device-sdk-embedded-C). |
| 56 | + * |
| 57 | + * <b>Default value</b>: Error logging is turned off, and no code is generated for calls |
| 58 | + * to the macro in the MQTT library on compilation. |
| 59 | + */ |
| 60 | +#ifndef LogError |
| 61 | + #define LogError( message ) |
| 62 | +#endif |
| 63 | + |
| 64 | +/** |
| 65 | + * @brief Macro that is called in the MQTT library for logging "Warning" level |
| 66 | + * messages. |
| 67 | + * |
| 68 | + * To enable warning level logging in the MQTT library, this macro should be mapped to the |
| 69 | + * application-specific logging implementation that supports warning logging. |
| 70 | + * |
| 71 | + * @note This logging macro is called in the MQTT library with parameters wrapped in |
| 72 | + * double parentheses to be ISO C89/C90 standard compliant. For a reference |
| 73 | + * POSIX implementation of the logging macros, refer to core_mqtt_config.h files, and the |
| 74 | + * logging-stack in demos folder of the |
| 75 | + * [AWS IoT Embedded C SDK repository](https://github.com/aws/aws-iot-device-sdk-embedded-C/). |
| 76 | + * |
| 77 | + * <b>Default value</b>: Warning logs are turned off, and no code is generated for calls |
| 78 | + * to the macro in the MQTT library on compilation. |
| 79 | + */ |
| 80 | +#ifndef LogWarn |
| 81 | + #define LogWarn( message ) |
| 82 | +#endif |
| 83 | + |
| 84 | +/** |
| 85 | + * @brief Macro that is called in the MQTT library for logging "Info" level |
| 86 | + * messages. |
| 87 | + * |
| 88 | + * To enable info level logging in the MQTT library, this macro should be mapped to the |
| 89 | + * application-specific logging implementation that supports info logging. |
| 90 | + * |
| 91 | + * @note This logging macro is called in the MQTT library with parameters wrapped in |
| 92 | + * double parentheses to be ISO C89/C90 standard compliant. For a reference |
| 93 | + * POSIX implementation of the logging macros, refer to core_mqtt_config.h files, and the |
| 94 | + * logging-stack in demos folder of the |
| 95 | + * [AWS IoT Embedded C SDK repository](https://github.com/aws/aws-iot-device-sdk-embedded-C/). |
| 96 | + * |
| 97 | + * <b>Default value</b>: Info logging is turned off, and no code is generated for calls |
| 98 | + * to the macro in the MQTT library on compilation. |
| 99 | + */ |
| 100 | +#ifndef LogInfo |
| 101 | + #define LogInfo( message ) |
| 102 | +#endif |
| 103 | + |
| 104 | +/** |
| 105 | + * @brief Macro that is called in the MQTT library for logging "Debug" level |
| 106 | + * messages. |
| 107 | + * |
| 108 | + * To enable debug level logging from MQTT library, this macro should be mapped to the |
| 109 | + * application-specific logging implementation that supports debug logging. |
| 110 | + * |
| 111 | + * @note This logging macro is called in the MQTT library with parameters wrapped in |
| 112 | + * double parentheses to be ISO C89/C90 standard compliant. For a reference |
| 113 | + * POSIX implementation of the logging macros, refer to core_mqtt_config.h files, and the |
| 114 | + * logging-stack in demos folder of the |
| 115 | + * [AWS IoT Embedded C SDK repository](https://github.com/aws/aws-iot-device-sdk-embedded-C/). |
| 116 | + * |
| 117 | + * <b>Default value</b>: Debug logging is turned off, and no code is generated for calls |
| 118 | + * to the macro in the MQTT library on compilation. |
| 119 | + */ |
| 120 | +#ifndef LogDebug |
| 121 | + #define LogDebug( message ) |
| 122 | +#endif |
| 123 | + |
| 124 | +/* *INDENT-OFF* */ |
| 125 | +#ifdef __cplusplus |
| 126 | + } |
| 127 | +#endif |
| 128 | +/* *INDENT-ON* */ |
| 129 | + |
| 130 | +#endif /* ifndef CORE_MQTT_DEFAULT_LOGGING_H_ */ |
0 commit comments