#define MINICOREDUMPER_CONFIG_PATH "@MINICOREDUMPER_CONFIG_PATH@"
#define DEBUGMODE_PATH "@DEBUGMODE_PATH@"
#define LIVEDUMPER_BIN_PATH "@LIVEDUMPER_BIN_PATH@"
+#define DLOG_LOG_LEVEL @DLOG_LOG_LEVEL@
#endif /* __DEFS_H__ */
* limitations under the License.
*/
-
-
#ifndef __CRASH_LOG_H__
#define __CRASH_LOG_H__
#endif
#include <dlog.h>
+#include "defs.h" // for DLOG_LOG_LEVEL
+
#ifdef LOG_FILE
#include <sys/types.h>
#include <unistd.h>
} while (0); })
#endif
-#define _D(fmt, arg...) SLOGD(fmt, ##arg)
-#define _I(fmt, arg...) SLOGI(fmt, ##arg)
-#define _W(fmt, arg...) SLOGW(fmt, ##arg)
-#define _E(fmt, arg...) SLOGE(fmt, ##arg)
+#define _D(fmt, arg...) do { if (DLOG_LOG_LEVEL <= DLOG_DEBUG) SLOGD(fmt, ##arg); } while (0)
+#define _I(fmt, arg...) do { if (DLOG_LOG_LEVEL <= DLOG_INFO) SLOGI(fmt, ##arg); } while (0)
+#define _W(fmt, arg...) do { if (DLOG_LOG_LEVEL <= DLOG_WARN) SLOGW(fmt, ##arg); } while (0)
+#define _E(fmt, arg...) do { if (DLOG_LOG_LEVEL <= DLOG_ERROR) SLOGE(fmt, ##arg); } while (0)
+
#define _SD(fmt, arg...) SECURE_SLOGD(fmt, ##arg)
#define _SI(fmt, arg...) SECURE_SLOGI(fmt, ##arg)
#define _SW(fmt, arg...) SECURE_SLOGW(fmt, ##arg)