diff options
Diffstat (limited to 'serd')
-rw-r--r-- | serd/serd.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h index 9b3e35f6..ec5d9228 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -42,6 +42,12 @@ # define SERD_API #endif +#if defined(__GNUC__) +# define SERD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) +#else +# define SERD_LOG_FUNC(fmt, arg1) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -823,6 +829,22 @@ serd_world_set_message_sink(SerdWorld* world, SerdMessageSink msg_sink, void* handle); +/// Write a message to the log +SERD_API +SerdStatus +serd_world_log(const SerdWorld* world, const SerdMessage* msg); + +/// Write a message to the log +SERD_API +SERD_LOG_FUNC(5, 6) +SerdStatus +serd_world_logf(const SerdWorld* world, + SerdStatus st, + SerdLogLevel level, + const SerdCursor* cursor, + const char* fmt, + ...); + /** @} @name Environment |