summaryrefslogtreecommitdiff
path: root/src/lib/eolian/eolian_database.h
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-20 17:05:22 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-20 17:34:51 +0100
commita1ae5cd918776ba3661e9ade588231f3b2a0db4e (patch)
treeff704bf400ce29b43de27db5b108a36cfe077a91 /src/lib/eolian/eolian_database.h
parent008d9901814f33a2c1f4d1e5058882494f0f9d48 (diff)
eolian: use new error logging for all recoverable errors
Diffstat (limited to 'src/lib/eolian/eolian_database.h')
-rw-r--r--src/lib/eolian/eolian_database.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 8b58d65..f2fccf2 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -110,6 +110,41 @@ eolian_object_add(Eolian_Object *obj, Eina_Stringshare *name, Eina_Hash *hash)
110 eolian_object_add(&obj->base, name, tunit->memb); \ 110 eolian_object_add(&obj->base, name, tunit->memb); \
111} 111}
112 112
113static inline void eolian_state_vlog(const Eolian_State *state, const Eolian_Object *obj, const char *fmt, va_list args) EINA_ARG_NONNULL(1, 3);
114static inline void eolian_state_log(const Eolian_State *state, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
115static inline void eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj, const char *fmt, ...) EINA_ARG_NONNULL(1, 2, 3) EINA_PRINTF(3, 4);
116
117
118static inline void
119eolian_state_vlog(const Eolian_State *state, const Eolian_Object *obj,
120 const char *fmt, va_list args)
121{
122 Eina_Strbuf *sb = eina_strbuf_new();
123 eina_strbuf_append_vprintf(sb, fmt, args);
124 state->error(obj, eina_strbuf_string_get(sb), state->error_data);
125 eina_strbuf_free(sb);
126}
127
128static inline void
129eolian_state_log(const Eolian_State *state, const char *fmt, ...)
130{
131 va_list args;
132 va_start(args, fmt);
133 eolian_state_vlog(state, NULL, fmt, args);
134 va_end(args);
135}
136
137static inline void
138eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj,
139 const char *fmt, ...)
140{
141 va_list args;
142 va_start(args, fmt);
143 eolian_state_vlog(state, obj, fmt, args);
144 va_end(args);
145}
146
147
113struct _Eolian_Documentation 148struct _Eolian_Documentation
114{ 149{
115 Eolian_Object base; 150 Eolian_Object base;