Vergil Cola
/
MQTTGatewayK64
Fork of my MQTTGateway
XbeeMonitor/XBeeLib/Utils/Debug.h@0:f1d3878b8dd9, 2017-04-08 (annotated)
- Committer:
- vpcola
- Date:
- Sat Apr 08 14:45:51 2017 +0000
- Revision:
- 0:f1d3878b8dd9
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vpcola | 0:f1d3878b8dd9 | 1 | /** |
vpcola | 0:f1d3878b8dd9 | 2 | * Copyright (c) 2015 Digi International Inc., |
vpcola | 0:f1d3878b8dd9 | 3 | * All rights not expressly granted are reserved. |
vpcola | 0:f1d3878b8dd9 | 4 | * |
vpcola | 0:f1d3878b8dd9 | 5 | * This Source Code Form is subject to the terms of the Mozilla Public |
vpcola | 0:f1d3878b8dd9 | 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
vpcola | 0:f1d3878b8dd9 | 7 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
vpcola | 0:f1d3878b8dd9 | 8 | * |
vpcola | 0:f1d3878b8dd9 | 9 | * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 |
vpcola | 0:f1d3878b8dd9 | 10 | * ======================================================================= |
vpcola | 0:f1d3878b8dd9 | 11 | */ |
vpcola | 0:f1d3878b8dd9 | 12 | |
vpcola | 0:f1d3878b8dd9 | 13 | #if !defined(__DEBUG_H_) |
vpcola | 0:f1d3878b8dd9 | 14 | #define __DEBUG_H_ |
vpcola | 0:f1d3878b8dd9 | 15 | |
vpcola | 0:f1d3878b8dd9 | 16 | #include "config.h" |
vpcola | 0:f1d3878b8dd9 | 17 | |
vpcola | 0:f1d3878b8dd9 | 18 | #if defined(ENABLE_LOGGING) |
vpcola | 0:f1d3878b8dd9 | 19 | |
vpcola | 0:f1d3878b8dd9 | 20 | #include "DigiLogger.h" |
vpcola | 0:f1d3878b8dd9 | 21 | |
vpcola | 0:f1d3878b8dd9 | 22 | #define digi_log(...) DigiLog::DigiLogger::log_format(__VA_ARGS__); |
vpcola | 0:f1d3878b8dd9 | 23 | #else |
vpcola | 0:f1d3878b8dd9 | 24 | #define digi_log(...) do {} while(0) |
vpcola | 0:f1d3878b8dd9 | 25 | #endif |
vpcola | 0:f1d3878b8dd9 | 26 | |
vpcola | 0:f1d3878b8dd9 | 27 | #if defined(ENABLE_ASSERTIONS) |
vpcola | 0:f1d3878b8dd9 | 28 | #include "mbed.h" |
vpcola | 0:f1d3878b8dd9 | 29 | #if !(defined assert) |
vpcola | 0:f1d3878b8dd9 | 30 | #define assert(expr) if (!(expr)) { \ |
vpcola | 0:f1d3878b8dd9 | 31 | digi_log(LogLevelNone, "Assertion failed: %s, file %s, line %d\n", \ |
vpcola | 0:f1d3878b8dd9 | 32 | #expr, __FILE__, __LINE__); \ |
vpcola | 0:f1d3878b8dd9 | 33 | mbed_die(); \ |
vpcola | 0:f1d3878b8dd9 | 34 | } |
vpcola | 0:f1d3878b8dd9 | 35 | #endif |
vpcola | 0:f1d3878b8dd9 | 36 | #else |
vpcola | 0:f1d3878b8dd9 | 37 | #define assert(expr) |
vpcola | 0:f1d3878b8dd9 | 38 | #endif |
vpcola | 0:f1d3878b8dd9 | 39 | |
vpcola | 0:f1d3878b8dd9 | 40 | #endif /* __DEBUG_H_ */ |