Method: Mosquitto::Client#on_log
- Defined in:
- ext/mosquitto/client.c
#on_log {|level, msg| ... } ⇒ Boolean
Set the logging callback. This should be used if you want event logging information from the client library.
2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 |
# File 'ext/mosquitto/client.c', line 2151
static VALUE rb_mosquitto_client_on_log(int argc, VALUE *argv, VALUE obj)
{
VALUE proc, cb;
MosquittoGetClient(obj);
rb_scan_args(argc, argv, "01&", &proc, &cb);
MosquittoAssertCallback(cb, 2);
if (!NIL_P(client->log_cb)) rb_gc_unregister_address(&client->log_cb);
mosquitto_log_callback_set(client->mosq, rb_mosquitto_client_on_log_cb);
client->log_cb = cb;
rb_gc_register_address(&client->log_cb);
return Qtrue;
}
|