mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 07:16:37 +02:00
Remove debug plugin (merged to core), new debug variable for each plugin (no more signals for setting debug)
This commit is contained in:
@@ -73,7 +73,7 @@ logger_buffer_add (struct t_gui_buffer *buffer, int log_level)
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
|
||||
if (logger_debug)
|
||||
if (weechat_logger_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: start logging for buffer \"%s\"",
|
||||
@@ -157,7 +157,7 @@ logger_buffer_free (struct t_logger_buffer *logger_buffer)
|
||||
{
|
||||
struct t_logger_buffer *new_logger_buffers;
|
||||
|
||||
if (logger_debug)
|
||||
if (weechat_logger_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: stop logging for buffer \"%s\"",
|
||||
|
||||
@@ -52,44 +52,9 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
|
||||
|
||||
struct t_weechat_plugin *weechat_logger_plugin = NULL;
|
||||
|
||||
int logger_debug = 0;
|
||||
|
||||
char *logger_buf_write = NULL; /* buffer for writing a line */
|
||||
|
||||
|
||||
/*
|
||||
* logger_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
logger_debug_cb (void *data, const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, LOGGER_PLUGIN_NAME) == 0)
|
||||
{
|
||||
logger_debug ^= 1;
|
||||
if (logger_debug)
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug enabled"),
|
||||
LOGGER_PLUGIN_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug disabled"),
|
||||
LOGGER_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* logger_create_directory: create logger directory
|
||||
* return 1 if success (directory created or already
|
||||
@@ -293,7 +258,7 @@ logger_get_filename (struct t_gui_buffer *buffer)
|
||||
if (!mask_decoded)
|
||||
return NULL;
|
||||
|
||||
if (logger_debug)
|
||||
if (weechat_logger_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: buffer = \"%s\", mask = \"%s\", "
|
||||
@@ -963,9 +928,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
if (logger_config_read () < 0)
|
||||
return WEECHAT_RC_ERROR;
|
||||
|
||||
/* callback for debug */
|
||||
weechat_hook_signal ("debug", &logger_debug_cb, NULL);
|
||||
|
||||
/* command /logger */
|
||||
weechat_hook_command ("logger",
|
||||
N_("logger plugin configuration"),
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#define LOGGER_BUF_WRITE_SIZE (16*1024)
|
||||
#define LOGGER_LEVEL_DEFAULT 9
|
||||
|
||||
extern int logger_debug;
|
||||
|
||||
extern struct t_weechat_plugin *weechat_logger_plugin;
|
||||
|
||||
extern void logger_start_buffer_all ();
|
||||
|
||||
Reference in New Issue
Block a user