History

ipc: make it possible to receive log messages

The receiving part was implemented, but since no messages are enabled by default, it couldn't be used.

wm4 committed 12 years ago

Commit dbc41ea1 parent de59b872 files · +23 −0Browse files

Unified · Split

2 files
  1. DOCS/man/ipc.rst +10 −0
  2. input/ipc.c +13 −0
DOCS/man/ipc.rst+10−0
@@ -146,6 +146,16 @@ extra commands can also be used as part of the protocol: · 145 unmodified lines
146146 { "command": ["unobserve_property", 1] }
147147 { "error": "success" }
148148
149+``request_log_messages``
150+ Enable output of mpv log messages. They will be received as events. The
151+ parameter to this command is the log-level (see ``mpv_request_log_messages``
152+ C API function).
153+
154+ Log message output is meant for humans only (mostly for debugging).
155+ Attempting to retrieve information by parsing these messages will just
156+ lead to breakages with future mpv releases. Instead, make a feature request,
157+ and ask for a proper event that returns the information you need.
158+
149159 ``suspend``
150160 Suspend the mpv main loop. There is a long-winded explanation of this in
151161 the C API function ``mpv_suspend()``. In short, this prevents the player
input/ipc.c+13−0
@@ -414,6 +414,19 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent, · 413 unmodified lines
414414
415415 rc = mpv_unobserve_property(arg->client,
416416 cmd_node->u.list->values[1].u.int64);
417+ } else if (!strcmp("request_log_messages", cmd)) {
418+ if (cmd_node->u.list->num != 2) {
419+ rc = MPV_ERROR_INVALID_PARAMETER;
420+ goto error;
421+ }
422+
423+ if (cmd_node->u.list->values[1].format != MPV_FORMAT_STRING) {
424+ rc = MPV_ERROR_INVALID_PARAMETER;
425+ goto error;
426+ }
427+
428+ rc = mpv_request_log_messages(arg->client,
429+ cmd_node->u.list->values[1].u.string);
417430 } else if (!strcmp("suspend", cmd)) {
418431 if (arg->suspend_counter < INT_MAX) {
419432 mpv_suspend(arg->client);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t