aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-lua.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-06-14 17:16:56 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-06-29 19:38:23 +0200
commitcb67a5441e0e4bbcb4572f0134d50614d7a68613 (patch)
tree8063a5318f98d3439825c313ba1e85418e5ea409 /ctl-lib/ctl-lua.c
parente796f2c67251caabf18bd04395cad601c5215a46 (diff)
Adjust to compile with incoming bindings v3
Change-Id: I0a3a1db6dacf017ecea5b91dc35eb3ec2d86515d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-lua.c')
-rw-r--r--ctl-lib/ctl-lua.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index 7e66e2c..cd3838f 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -277,10 +277,12 @@ static int LuaFormatMessage(lua_State* luaState, int verbosity, int level) {
return 1;
// if log level low then silently ignore message
-#ifdef AFB_BINDING_PREV3
+#ifndef AFB_BINDING_PREV3
+ if (afb_get_verbosity() < verbosity) return 0;
+#elif !defined(AFB_BINDING_INTERFACE_VERSION)
if (source->api->verbosity < verbosity) return 0;
#else
- if (afb_get_verbosity() < verbosity) return 0;
+ if (!afb_dynapi_wants_log_level(source->api, level)) return 0;
#endif
json_object *responseJ = LuaPopArgs(source, luaState, LUA_FIST_ARG + 1);