summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-09-17 16:12:41 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-09-17 16:12:41 +0200
commit8b26f3c953f248cc2d66b2bf1a296f76e48c4c6d (patch)
treed668aea1e33305f24b49ccf989ad66dbf28c3746 /src
parentefcc5010b690c8723fc012df3199188653764744 (diff)
downloadweechat-8b26f3c953f248cc2d66b2bf1a296f76e48c4c6d.zip
Add optional plugin name for command /debug dump and signal "debug_dump"
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-command.c22
-rw-r--r--src/core/wee-debug.c10
-rw-r--r--src/plugins/irc/irc-debug.c23
-rw-r--r--src/plugins/relay/relay.c25
-rw-r--r--src/plugins/rmodifier/rmodifier-debug.c23
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c7
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c7
-rw-r--r--src/plugins/scripts/python/weechat-python.c7
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby.c7
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl.c7
-rw-r--r--src/plugins/xfer/xfer.c23
11 files changed, 96 insertions, 65 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 616d6c933..c5db08ae5 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -1063,9 +1063,13 @@ command_debug (void *data, struct t_gui_buffer *buffer,
if (string_strcasecmp (argv[1], "dump") == 0)
{
- log_printf ("Dump request for WeeChat core and plugins");
+ if (argc > 2)
+ log_printf ("Dump request for plugin: \"%s\"", argv_eol[2]);
+ else
+ log_printf ("Dump request for WeeChat core and plugins");
weechat_log_use_time = 0;
- hook_signal_send ("debug_dump", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ hook_signal_send ("debug_dump", WEECHAT_HOOK_SIGNAL_STRING,
+ (argc > 2) ? argv_eol[2] : NULL);
weechat_log_use_time = 1;
}
else if (string_strcasecmp (argv[1], "buffer") == 0)
@@ -4575,8 +4579,8 @@ command_init ()
&command_command, NULL);
hook_command (NULL, "debug",
N_("control debug for core/plugins"),
- N_("[list | set plugin level | dump | buffer | windows | "
- "term]"),
+ N_("[list | set plugin level | dump [plugin] | buffer | "
+ "windows | term]"),
N_(" set: set log level for plugin\n"
" plugin: name of plugin (\"core\" for WeeChat core)\n"
" level: debug level for plugin (0 = disable debug)\n"
@@ -4588,11 +4592,11 @@ command_init ()
" term: display infos about terminal and available "
"colors"),
"list"
- "|| set %(plugins_names)|core"
- "|| dump"
- "|| buffer"
- "|| windows"
- "|| term",
+ " || set %(plugins_names)|core"
+ " || dump %(plugins_names)|core"
+ " || buffer"
+ " || windows"
+ " || term",
&command_debug, NULL);
hook_command (NULL, "filter",
N_("filter messages in buffers, to hide/show them according "
diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c
index d75ffa1ef..6035b46c4 100644
--- a/src/core/wee-debug.c
+++ b/src/core/wee-debug.c
@@ -117,9 +117,9 @@ debug_dump_cb (void *data, const char *signal, const char *type_data,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- debug_dump (0);
+ if (!signal_data || (string_strcasecmp ((char *)signal_data, "core") == 0))
+ debug_dump (0);
return WEECHAT_RC_OK;
}
@@ -263,7 +263,7 @@ debug_windows_cb (void *data, const char *signal, const char *type_data,
void
debug_init ()
{
- hook_signal (NULL, "debug_dump", debug_dump_cb, NULL);
- hook_signal (NULL, "debug_buffer", debug_buffer_cb, NULL);
- hook_signal (NULL, "debug_windows", debug_windows_cb, NULL);
+ hook_signal (NULL, "debug_dump", &debug_dump_cb, NULL);
+ hook_signal (NULL, "debug_buffer", &debug_buffer_cb, NULL);
+ hook_signal (NULL, "debug_windows", &debug_windows_cb, NULL);
}
diff --git a/src/plugins/irc/irc-debug.c b/src/plugins/irc/irc-debug.c
index 5a0eb32d0..3d8a1202c 100644
--- a/src/plugins/irc/irc-debug.c
+++ b/src/plugins/irc/irc-debug.c
@@ -42,17 +42,20 @@ irc_debug_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- weechat_log_printf ("");
- weechat_log_printf ("***** \"%s\" plugin dump *****",
- weechat_plugin->name);
-
- irc_server_print_log ();
-
- weechat_log_printf ("");
- weechat_log_printf ("***** End of \"%s\" plugin dump *****",
- weechat_plugin->name);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, IRC_PLUGIN_NAME) == 0))
+ {
+ weechat_log_printf ("");
+ weechat_log_printf ("***** \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ irc_server_print_log ();
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** End of \"%s\" plugin dump *****",
+ weechat_plugin->name);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/relay/relay.c b/src/plugins/relay/relay.c
index 5ededd5ed..6fa4a19d6 100644
--- a/src/plugins/relay/relay.c
+++ b/src/plugins/relay/relay.c
@@ -102,18 +102,21 @@ relay_debug_dump_cb (void *data, const char *signal, const char *type_data,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
-
- weechat_log_printf ("");
- weechat_log_printf ("***** \"%s\" plugin dump *****",
- weechat_plugin->name);
- relay_server_print_log ();
- relay_client_print_log ();
-
- weechat_log_printf ("");
- weechat_log_printf ("***** End of \"%s\" plugin dump *****",
- weechat_plugin->name);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, RELAY_PLUGIN_NAME) == 0))
+ {
+ weechat_log_printf ("");
+ weechat_log_printf ("***** \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ relay_server_print_log ();
+ relay_client_print_log ();
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** End of \"%s\" plugin dump *****",
+ weechat_plugin->name);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/rmodifier/rmodifier-debug.c b/src/plugins/rmodifier/rmodifier-debug.c
index 3820edaa6..66309d523 100644
--- a/src/plugins/rmodifier/rmodifier-debug.c
+++ b/src/plugins/rmodifier/rmodifier-debug.c
@@ -41,17 +41,20 @@ rmodifier_debug_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- weechat_log_printf ("");
- weechat_log_printf ("***** \"%s\" plugin dump *****",
- weechat_plugin->name);
-
- rmodifier_print_log ();
-
- weechat_log_printf ("");
- weechat_log_printf ("***** End of \"%s\" plugin dump *****",
- weechat_plugin->name);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, RMODIFIER_PLUGIN_NAME) == 0))
+ {
+ weechat_log_printf ("");
+ weechat_log_printf ("***** \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ rmodifier_print_log ();
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** End of \"%s\" plugin dump *****",
+ weechat_plugin->name);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index aeea789d4..3486239d4 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -609,9 +609,12 @@ weechat_lua_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- script_print_log (weechat_lua_plugin, lua_scripts);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, LUA_PLUGIN_NAME) == 0))
+ {
+ script_print_log (weechat_lua_plugin, lua_scripts);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index 32a7ff41a..73693d2b4 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -817,9 +817,12 @@ weechat_perl_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- script_print_log (weechat_perl_plugin, perl_scripts);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, PERL_PLUGIN_NAME) == 0))
+ {
+ script_print_log (weechat_perl_plugin, perl_scripts);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index fabe584da..fb8d46779 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -831,9 +831,12 @@ weechat_python_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- script_print_log (weechat_python_plugin, python_scripts);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, PYTHON_PLUGIN_NAME) == 0))
+ {
+ script_print_log (weechat_python_plugin, python_scripts);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c
index 951177a36..31dc8795d 100644
--- a/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/src/plugins/scripts/ruby/weechat-ruby.c
@@ -853,9 +853,12 @@ weechat_ruby_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- script_print_log (weechat_ruby_plugin, ruby_scripts);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, RUBY_PLUGIN_NAME) == 0))
+ {
+ script_print_log (weechat_ruby_plugin, ruby_scripts);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/scripts/tcl/weechat-tcl.c b/src/plugins/scripts/tcl/weechat-tcl.c
index 540e6391b..9dfd05a0e 100644
--- a/src/plugins/scripts/tcl/weechat-tcl.c
+++ b/src/plugins/scripts/tcl/weechat-tcl.c
@@ -600,9 +600,12 @@ weechat_tcl_signal_debug_dump_cb (void *data, const char *signal,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
- script_print_log (weechat_tcl_plugin, tcl_scripts);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, TCL_PLUGIN_NAME) == 0))
+ {
+ script_print_log (weechat_tcl_plugin, tcl_scripts);
+ }
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c
index 21df1335c..833bb4b26 100644
--- a/src/plugins/xfer/xfer.c
+++ b/src/plugins/xfer/xfer.c
@@ -1409,17 +1409,20 @@ xfer_debug_dump_cb (void *data, const char *signal, const char *type_data,
(void) data;
(void) signal;
(void) type_data;
- (void) signal_data;
-
- weechat_log_printf ("");
- weechat_log_printf ("***** \"%s\" plugin dump *****",
- weechat_plugin->name);
-
- xfer_print_log ();
- weechat_log_printf ("");
- weechat_log_printf ("***** End of \"%s\" plugin dump *****",
- weechat_plugin->name);
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, XFER_PLUGIN_NAME) == 0))
+ {
+ weechat_log_printf ("");
+ weechat_log_printf ("***** \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ xfer_print_log ();
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** End of \"%s\" plugin dump *****",
+ weechat_plugin->name);
+ }
return WEECHAT_RC_OK;
}