mirror of
https://github.com/troglobit/finit.git
synced 2026-11-21 19:51:46 +00:00
libink: trace connections, calls, and authorization decisions
The legacy socket logs a line per command under initctl debug; the bus logged nothing, so the transport that now carries most of initctl was the one you could not watch. libink gets a logger hook rather than a dependency on Finit's: it passes the emitting function and a formatted message, and dbus.c hands both to logit() so the two sources read alike. Trace points cover the connection lifecycle, every inbound call, and why a call was refused. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
63aabaa6df
commit
1e508f9168
9 files changed
+94
-1
No files matched your search
@@ -88,6 +88,20 @@ typedef struct {
|
||||
size_t body_len;
|
||||
} link_reply_t;
|
||||
|
||||
/* ---------- debug tracing ---------- */
|
||||
|
||||
/* Receives one line per connection, method call, and authorization
|
||||
* decision. `func` is the libink function that emitted it, so a host
|
||||
* can format it the way it formats its own traces.
|
||||
*
|
||||
* With no logger installed, the default, a trace point costs one NULL
|
||||
* test. With one installed the message is formatted before the host
|
||||
* sees it, so a host that only wants tracing sometimes should install
|
||||
* and remove the callback rather than discard by level. */
|
||||
typedef void (*link_log_cb_t)(void *userdata, const char *func, const char *msg);
|
||||
|
||||
void link_set_logger(link_log_cb_t cb, void *userdata);
|
||||
|
||||
/* ---------- caller identity on a broker connection ---------- */
|
||||
|
||||
/* Handle for a call parked while its caller is identified. Opaque,
|
||||
|
||||
Reference in new issue
Block a user