diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-30 02:03:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-30 02:03:32 +0300 |
commit | 244991dee7a2e274cb361f5040dd39b0f2997290 (patch) | |
tree | 1561cedb98b1f2df73fb49cc26f48eb14d01e520 /src/logger.h | |
parent | 22795c4301cd6b62a8270b45a72a850ed888daf8 (diff) | |
download | ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.tar.gz ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.tar.bz2 ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.tar.xz ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.zip |
Extend assert reporting functions with condition text and call stack.
Diffstat (limited to 'src/logger.h')
-rw-r--r-- | src/logger.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/logger.h b/src/logger.h index abf2a72c1..0088facc8 100644 --- a/src/logger.h +++ b/src/logger.h @@ -118,6 +118,27 @@ class Logger final ; /** + * Enters a message in the log. The message will be timestamped. + */ + void assert(const char *const log_text, ...) A_NONNULL(2) +#ifdef __GNUC__ +#ifdef __OpenBSD__ + + __attribute__((__format__(printf, 2, 3))) +#else // __OpenBSD__ + +#ifdef ENABLE_CILKPLUS + __attribute__((__format__(gnu_printf, 1, 2))) +#else // ENABLE_CILKPLUS + + __attribute__((__format__(gnu_printf, 2, 3))) +#endif // ENABLE_CILKPLUS + +#endif // __OpenBSD__ +#endif // __GNUC__ + ; + + /** * Enters a message in the log (thread safe). */ void log_r(const char *const log_text, ...) A_NONNULL(2) |