summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-10-10 21:45:56 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-10-10 21:45:56 (GMT)
commit96afc0325e1c85bf1a76d63c6441cf8f044708fe (patch)
tree1cf431fb3a888f9da14c0f3d46ee70bcd336a983 /src/core
parentae1744244fa777535cc707b9e6a014eb281b982c (diff)
Introduced first steps towards database snapshots.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/logs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/logs.h b/src/core/logs.h
index 8019382..5455a92 100644
--- a/src/core/logs.h
+++ b/src/core/logs.h
@@ -132,6 +132,15 @@ void log_variadic_message(LogMessageType, const char *, ...);
} \
while (0)
+#define LOG_ERROR_SQLITE(db, func) \
+ do \
+ { \
+ const char *__msg; \
+ __msg = (db != NULL ? sqlite3_errmsg(db) : "unabled to allocate memory"); \
+ log_variadic_message(LMT_EXT_ERROR, "[%s:%u] %s: %s", __FUNCTION__, __LINE__, func, __msg); \
+ } \
+ while (0)
+
#endif /* _CORE_LOGS_H */