1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:25:42 +02:00

Remove some messages during startup about scripts and plugins loaded

It is still possible to see messages by changing debug level for "core" or
plugins (perl, python, ruby, lua, tcl).
This commit is contained in:
Sebastien Helleu
2009-03-18 15:11:18 +01:00
parent 763f030ae8
commit a938ef736a
33 changed files with 530 additions and 200 deletions
+8 -5
View File
@@ -107,7 +107,7 @@ weechat_lua_api_register (lua_State *L)
/* register script */
lua_current_script = script_add (weechat_lua_plugin,
&lua_scripts,
&lua_scripts, &last_lua_script,
(lua_current_script_filename) ?
lua_current_script_filename : "",
name,
@@ -119,10 +119,13 @@ weechat_lua_api_register (lua_State *L)
charset);
if (lua_current_script)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
LUA_PLUGIN_NAME, name, version, description);
if ((weechat_lua_plugin->debug >= 1) || !lua_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
LUA_PLUGIN_NAME, name, version, description);
}
}
else
{
+21 -10
View File
@@ -42,7 +42,9 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
struct t_weechat_plugin *weechat_lua_plugin;
int lua_quiet = 0;
struct t_plugin_script *lua_scripts = NULL;
struct t_plugin_script *last_lua_script = NULL;
struct t_plugin_script *lua_current_script = NULL;
const char *lua_current_script_filename = NULL;
lua_State *lua_current_interpreter = NULL;
@@ -95,7 +97,8 @@ weechat_lua_exec (struct t_plugin_script *script,
if (argv[6])
{
argc = 7;
lua_pushstring (lua_current_interpreter, argv[6]);
lua_pushstring (lua_current_interpreter,
argv[6]);
}
}
}
@@ -160,9 +163,12 @@ weechat_lua_load (const char *filename)
return 0;
}
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
LUA_PLUGIN_NAME, filename);
if ((weechat_lua_plugin->debug >= 1) || !lua_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
LUA_PLUGIN_NAME, filename);
}
lua_current_script = NULL;
@@ -233,7 +239,7 @@ weechat_lua_load (const char *filename)
fclose (fp);
/* if script was registered, removing from list */
if (lua_current_script)
script_remove (weechat_lua_plugin, &lua_scripts,
script_remove (weechat_lua_plugin, &lua_scripts, &last_lua_script,
lua_current_script);
return 0;
}
@@ -298,7 +304,7 @@ weechat_lua_unload (struct t_plugin_script *script)
lua_current_script = (lua_current_script->prev_script) ?
lua_current_script->prev_script : lua_current_script->next_script;
script_remove (weechat_lua_plugin, &lua_scripts, script);
script_remove (weechat_lua_plugin, &lua_scripts, &last_lua_script, script);
lua_close (script->interpreter);
}
@@ -448,8 +454,8 @@ weechat_lua_completion_cb (void *data, const char *completion_item,
*/
int
weechat_lua_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_lua_debug_dump_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -467,8 +473,8 @@ weechat_lua_debug_dump_cb (void *data, const char *signal, const char *type_data
*/
int
weechat_lua_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_lua_buffer_closed_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -494,12 +500,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
weechat_lua_plugin = plugin;
lua_quiet = 1;
script_init (weechat_lua_plugin,
&weechat_lua_command_cb,
&weechat_lua_completion_cb,
&weechat_lua_debug_dump_cb,
&weechat_lua_buffer_closed_cb,
&weechat_lua_load_cb);
lua_quiet = 0;
script_display_short_list (weechat_lua_plugin,
lua_scripts);
/* init ok */
return WEECHAT_RC_OK;
+2
View File
@@ -25,7 +25,9 @@
extern struct t_weechat_plugin *weechat_lua_plugin;
extern int lua_quiet;
extern struct t_plugin_script *lua_scripts;
extern struct t_plugin_script *last_lua_script;
extern struct t_plugin_script *lua_current_script;
extern const char *lua_current_script_filename;
extern lua_State *lua_current_interpreter;
+8 -5
View File
@@ -104,17 +104,20 @@ static XS (XS_weechat_api_register)
/* register script */
perl_current_script = script_add (weechat_perl_plugin,
&perl_scripts,
&perl_scripts, &last_perl_script,
(perl_current_script_filename) ?
perl_current_script_filename : "",
name, author, version, license,
description, shutdown_func, charset);
if (perl_current_script)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
PERL_PLUGIN_NAME, name, version, description);
if ((weechat_perl_plugin->debug >= 1) || !perl_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
PERL_PLUGIN_NAME, name, version, description);
}
}
else
{
+21 -9
View File
@@ -40,7 +40,9 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
struct t_weechat_plugin *weechat_perl_plugin = NULL;
int perl_quiet = 0;
struct t_plugin_script *perl_scripts = NULL;
struct t_plugin_script *last_perl_script = NULL;
struct t_plugin_script *perl_current_script = NULL;
const char *perl_current_script_filename = NULL;
@@ -259,9 +261,12 @@ weechat_perl_load (const char *filename)
return 0;
}
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
PERL_PLUGIN_NAME, filename);
if ((weechat_perl_plugin->debug >= 1) || !perl_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
PERL_PLUGIN_NAME, filename);
}
perl_current_script = NULL;
@@ -354,7 +359,8 @@ weechat_perl_load (const char *filename)
#endif
if (perl_current_script && (perl_current_script != &temp_script))
{
script_remove (weechat_perl_plugin, &perl_scripts,
script_remove (weechat_perl_plugin,
&perl_scripts, &last_perl_script,
perl_current_script);
}
@@ -436,7 +442,8 @@ weechat_perl_unload (struct t_plugin_script *script)
perl_current_script = (perl_current_script->prev_script) ?
perl_current_script->prev_script : perl_current_script->next_script;
script_remove (weechat_perl_plugin, &perl_scripts, script);
script_remove (weechat_perl_plugin, &perl_scripts, &last_perl_script,
script);
#ifdef MULTIPLICITY
perl_destruct (interpreter);
@@ -592,8 +599,8 @@ weechat_perl_completion_cb (void *data, const char *completion_item,
*/
int
weechat_perl_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_perl_debug_dump_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -611,8 +618,8 @@ weechat_perl_debug_dump_cb (void *data, const char *signal, const char *type_dat
*/
int
weechat_perl_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_perl_buffer_closed_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -669,12 +676,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
eval_pv (perl_weechat_code, TRUE);
#endif
perl_quiet = 1;
script_init (weechat_perl_plugin,
&weechat_perl_command_cb,
&weechat_perl_completion_cb,
&weechat_perl_debug_dump_cb,
&weechat_perl_buffer_closed_cb,
&weechat_perl_load_cb);
perl_quiet = 0;
script_display_short_list (weechat_perl_plugin,
perl_scripts);
/* init ok */
return WEECHAT_RC_OK;
+2
View File
@@ -25,7 +25,9 @@
extern struct t_weechat_plugin *weechat_perl_plugin;
extern int perl_quiet;
extern struct t_plugin_script *perl_scripts;
extern struct t_plugin_script *last_perl_script;
extern struct t_plugin_script *perl_current_script;
extern const char *perl_current_script_filename;
@@ -95,17 +95,20 @@ weechat_python_api_register (PyObject *self, PyObject *args)
/* register script */
python_current_script = script_add (weechat_python_plugin,
&python_scripts,
&python_scripts, &last_python_script,
(python_current_script_filename) ?
python_current_script_filename : "",
name, author, version, license,
description, shutdown_func, charset);
if (python_current_script)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
PYTHON_PLUGIN_NAME, name, version, description);
if ((weechat_python_plugin->debug >= 1) || !python_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
PYTHON_PLUGIN_NAME, name, version, description);
}
}
else
{
File diff suppressed because it is too large Load Diff
@@ -25,7 +25,9 @@
extern struct t_weechat_plugin *weechat_python_plugin;
extern int python_quiet;
extern struct t_plugin_script *python_scripts;
extern struct t_plugin_script *last_python_script;
extern struct t_plugin_script *python_current_script;
extern const char *python_current_script_filename;
+8 -5
View File
@@ -111,7 +111,7 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author,
/* register script */
ruby_current_script = script_add (weechat_ruby_plugin,
&ruby_scripts,
&ruby_scripts, &last_ruby_script,
(ruby_current_script_filename) ?
ruby_current_script_filename : "",
c_name, c_author, c_version, c_license,
@@ -120,10 +120,13 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author,
if (ruby_current_script)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
RUBY_PLUGIN_NAME, c_name, c_version, c_description);
if ((weechat_ruby_plugin->debug >= 1) || !ruby_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
RUBY_PLUGIN_NAME, c_name, c_version, c_description);
}
}
else
{
+29 -13
View File
@@ -41,7 +41,9 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
struct t_weechat_plugin *weechat_ruby_plugin = NULL;
int ruby_quiet = 0;
struct t_plugin_script *ruby_scripts = NULL;
struct t_plugin_script *last_ruby_script = NULL;
struct t_plugin_script *ruby_current_script = NULL;
const char *ruby_current_script_filename = NULL;
@@ -340,9 +342,12 @@ weechat_ruby_load (const char *filename)
return 0;
}
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
RUBY_PLUGIN_NAME, filename);
if ((weechat_ruby_plugin->debug >= 1) || !ruby_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
RUBY_PLUGIN_NAME, filename);
}
ruby_current_script = NULL;
@@ -429,7 +434,8 @@ weechat_ruby_load (const char *filename)
if (ruby_current_script != NULL)
{
script_remove (weechat_ruby_plugin, &ruby_scripts,
script_remove (weechat_ruby_plugin,
&ruby_scripts, &last_ruby_script,
ruby_current_script);
}
@@ -495,7 +501,8 @@ weechat_ruby_unload (struct t_plugin_script *script)
ruby_current_script = (ruby_current_script->prev_script) ?
ruby_current_script->prev_script : ruby_current_script->next_script;
script_remove (weechat_ruby_plugin, &ruby_scripts, script);
script_remove (weechat_ruby_plugin, &ruby_scripts, &last_ruby_script,
script);
if (interpreter)
rb_gc_unregister_address (interpreter);
@@ -646,8 +653,8 @@ weechat_ruby_completion_cb (void *data, const char *completion_item,
*/
int
weechat_ruby_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_ruby_debug_dump_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -665,8 +672,8 @@ weechat_ruby_debug_dump_cb (void *data, const char *signal, const char *type_dat
*/
int
weechat_ruby_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_ruby_buffer_closed_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -750,10 +757,14 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* redirect stdin and stdout */
ruby_mWeechatOutputs = rb_define_module("WeechatOutputs");
rb_define_singleton_method(ruby_mWeechatOutputs, "write", weechat_ruby_output, 1);
rb_define_singleton_method(ruby_mWeechatOutputs, "puts", weechat_ruby_output, 1);
rb_define_singleton_method(ruby_mWeechatOutputs, "p", weechat_ruby_output, 1);
rb_define_singleton_method(ruby_mWeechatOutputs, "flush", weechat_ruby_output_flush, 0);
rb_define_singleton_method(ruby_mWeechatOutputs, "write",
weechat_ruby_output, 1);
rb_define_singleton_method(ruby_mWeechatOutputs, "puts",
weechat_ruby_output, 1);
rb_define_singleton_method(ruby_mWeechatOutputs, "p",
weechat_ruby_output, 1);
rb_define_singleton_method(ruby_mWeechatOutputs, "flush",
weechat_ruby_output_flush, 0);
rb_eval_string_protect(weechat_ruby_code, &ruby_error);
if (ruby_error)
@@ -770,12 +781,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
return WEECHAT_RC_ERROR;
}
ruby_quiet = 1;
script_init (weechat_ruby_plugin,
&weechat_ruby_command_cb,
&weechat_ruby_completion_cb,
&weechat_ruby_debug_dump_cb,
&weechat_ruby_buffer_closed_cb,
&weechat_ruby_load_cb);
ruby_quiet = 0;
script_display_short_list (weechat_ruby_plugin,
ruby_scripts);
/* init ok */
return WEECHAT_RC_OK;
+2
View File
@@ -25,7 +25,9 @@
extern struct t_weechat_plugin *weechat_ruby_plugin;
extern int ruby_quiet;
extern struct t_plugin_script *ruby_scripts;
extern struct t_plugin_script *last_ruby_script;
extern struct t_plugin_script *ruby_current_script;
extern const char *ruby_current_script_filename;
+2 -2
View File
@@ -90,10 +90,10 @@ script_callback_remove (struct t_plugin_script *script,
{
/* remove callback from list */
if (script_callback->prev_callback)
script_callback->prev_callback->next_callback =
(script_callback->prev_callback)->next_callback =
script_callback->next_callback;
if (script_callback->next_callback)
script_callback->next_callback->prev_callback =
(script_callback->next_callback)->prev_callback =
script_callback->prev_callback;
if (script->callbacks == script_callback)
script->callbacks = script_callback->next_callback;
File diff suppressed because it is too large Load Diff
+4
View File
@@ -85,6 +85,7 @@ extern char *script_search_full_name (struct t_weechat_plugin *weechat_plugin,
const char *filename);
extern struct t_plugin_script *script_add (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
struct t_plugin_script **last_script,
const char *filename, const char *name,
const char *author, const char *version,
const char *license, const char *description,
@@ -93,6 +94,7 @@ extern void script_remove_buffer_callbacks (struct t_plugin_script *scripts,
struct t_gui_buffer *buffer);
extern void script_remove (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
struct t_plugin_script **last_script,
struct t_plugin_script *script);
extern void script_completion (struct t_weechat_plugin *weechat_plugin,
struct t_gui_completion *completion,
@@ -100,6 +102,8 @@ extern void script_completion (struct t_weechat_plugin *weechat_plugin,
extern void script_display_list (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
const char *name, int full);
extern void script_display_short_list (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
extern void script_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
+8 -5
View File
@@ -198,17 +198,20 @@ weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc,
/* register script */
tcl_current_script = script_add (weechat_tcl_plugin,
&tcl_scripts,
&tcl_scripts, &last_tcl_script,
(tcl_current_script_filename) ?
tcl_current_script_filename : "",
name, author, version, license,
description, shutdown_func, charset);
if (tcl_current_script)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
TCL_PLUGIN_NAME, name, version, description);
if ((weechat_tcl_plugin->debug >= 1) || !tcl_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
TCL_PLUGIN_NAME, name, version, description);
}
tcl_current_script->interpreter = (void *)interp;
}
else
+18 -8
View File
@@ -43,7 +43,9 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
struct t_weechat_plugin *weechat_tcl_plugin = NULL;
int tcl_quiet = 0;
struct t_plugin_script *tcl_scripts = NULL;
struct t_plugin_script *last_tcl_script = NULL;
struct t_plugin_script *tcl_current_script = NULL;
const char *tcl_current_script_filename = NULL;
@@ -155,9 +157,12 @@ weechat_tcl_load (const char *filename)
return 0;
}
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
TCL_PLUGIN_NAME, filename);
if ((weechat_tcl_plugin->debug >= 1) || !tcl_quiet)
{
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
TCL_PLUGIN_NAME, filename);
}
tcl_current_script = NULL;
@@ -239,7 +244,7 @@ weechat_tcl_unload (struct t_plugin_script *script)
tcl_current_script = (tcl_current_script->prev_script) ?
tcl_current_script->prev_script : tcl_current_script->next_script;
script_remove (weechat_tcl_plugin, &tcl_scripts, script);
script_remove (weechat_tcl_plugin, &tcl_scripts, &last_tcl_script, script);
Tcl_DeleteInterp(interp);
}
@@ -389,8 +394,8 @@ weechat_tcl_completion_cb (void *data, const char *completion_item,
*/
int
weechat_tcl_debug_dump_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_tcl_debug_dump_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -408,8 +413,8 @@ weechat_tcl_debug_dump_cb (void *data, const char *signal, const char *type_data
*/
int
weechat_tcl_buffer_closed_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
weechat_tcl_buffer_closed_cb (void *data, const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
(void) data;
@@ -435,12 +440,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
weechat_tcl_plugin = plugin;
tcl_quiet = 1;
script_init (weechat_tcl_plugin,
weechat_tcl_command_cb,
weechat_tcl_completion_cb,
weechat_tcl_debug_dump_cb,
weechat_tcl_buffer_closed_cb,
weechat_tcl_load_cb);
tcl_quiet = 0;
script_display_short_list (weechat_tcl_plugin,
tcl_scripts);
/* init ok */
return WEECHAT_RC_OK;
+2
View File
@@ -25,7 +25,9 @@
extern struct t_weechat_plugin *weechat_tcl_plugin;
extern int tcl_quiet;
extern struct t_plugin_script *tcl_scripts;
extern struct t_plugin_script *last_tcl_script;
extern struct t_plugin_script *tcl_current_script;
extern const char *tcl_current_script_filename;