mirror of
https://github.com/mpv-player/mpv
synced 2025-02-02 21:21:33 +00:00
0ec5d35d57
Maybe using strings for log levels was a mistake (too broad and too impractical), so I'm adding numeric log level at least for the receiver side. This makes it easier to map mpv log levels to other logging systems. I'm still too stingy to add a function to set the log level by a numeric value, though. The numeric values are not directly mapped to the internal mpv values, because then almost every file in mpv would have to include the client API header. Coalesce this into API version 1.6, since 1.6 was bumped just yesterday.
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
#ifndef MP_MSG_CONTROL_H
|
|
#define MP_MSG_CONTROL_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
struct mpv_global;
|
|
void mp_msg_init(struct mpv_global *global);
|
|
void mp_msg_uninit(struct mpv_global *global);
|
|
void mp_msg_update_msglevels(struct mpv_global *global);
|
|
void mp_msg_mute(struct mpv_global *global, bool mute);
|
|
void mp_msg_force_stderr(struct mpv_global *global, bool force_stderr);
|
|
void mp_msg_flush_status_line(struct mpv_global *global);
|
|
bool mp_msg_has_status_line(struct mpv_global *global);
|
|
|
|
struct mp_log_buffer_entry {
|
|
char *prefix;
|
|
int level;
|
|
char *text;
|
|
};
|
|
|
|
struct mp_log_buffer;
|
|
struct mp_log_buffer *mp_msg_log_buffer_new(struct mpv_global *global,
|
|
int size, int level,
|
|
void (*wakeup_cb)(void *ctx),
|
|
void *wakeup_cb_ctx);
|
|
void mp_msg_log_buffer_destroy(struct mp_log_buffer *buffer);
|
|
struct mp_log_buffer_entry *mp_msg_log_buffer_read(struct mp_log_buffer *buffer);
|
|
|
|
int mp_msg_open_stats_file(struct mpv_global *global, const char *path);
|
|
|
|
struct bstr;
|
|
int mp_msg_split_msglevel(struct bstr *s, struct bstr *out_mod, int *out_level);
|
|
|
|
extern const char *const mp_log_levels[MSGL_MAX + 1];
|
|
extern const int const mp_mpv_log_levels[MSGL_MAX + 1];
|
|
|
|
#endif
|