* @return
*/
gboolean lua_push_internet_address (lua_State *L, InternetAddress *ia);
+
+/**
+ * Log lua object to string
+ * @param L
+ * @param pos
+ * @param outbuf
+ * @param len
+ * @return
+ */
+gsize lua_logger_out_type (lua_State *L, gint pos, gchar *outbuf,
+ gsize len);
#endif /* WITH_LUA */
#endif /* RSPAMD_LUA_H */
-- Output: a=string, b=1.50000, c=1, d={[1] = aa, [2] = 1, [3] = bb} e={[key]=value, [key2]=1.0}
*/
-static gsize lua_logger_out_type (lua_State *L, gint pos, gchar *outbuf,
- gsize len);
-
/* Logger methods */
/***
* @function logger.err(msg)
#undef MOVE_BUF
-static gsize
+gsize
lua_logger_out_type (lua_State *L, gint pos, gchar *outbuf, gsize len)
{
gint type;
case LUA_TFUNCTION:
r = rspamd_snprintf (outbuf, len + 1, "function");
break;
+ case LUA_TNIL:
+ r = rspamd_snprintf (outbuf, len + 1, "nil");
+ break;
+ case LUA_TNONE:
+ r = rspamd_snprintf (outbuf, len + 1, "no value");
+ break;
default:
/* Try to push everything as string using tostring magic */
r = lua_logger_out_str (L, pos, outbuf, len);