diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-03-18 15:11:18 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-03-18 15:11:18 +0100 |
commit | a938ef736a3f2da17aecc73d21f5a1acb611b5cf (patch) | |
tree | b98eeb95e778f7f508a3769556851ea1c0aa826a /src/plugins/scripts/perl | |
parent | 763f030ae876a31f8412590d1386d21dfe1e27b8 (diff) | |
download | weechat-a938ef736a3f2da17aecc73d21f5a1acb611b5cf.zip |
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).
Diffstat (limited to 'src/plugins/scripts/perl')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 13 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 30 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.h | 2 |
3 files changed, 31 insertions, 14 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 192e3ed2e..e38361d65 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -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 { diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index df97e925e..04c0437ad 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -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; diff --git a/src/plugins/scripts/perl/weechat-perl.h b/src/plugins/scripts/perl/weechat-perl.h index 5320f4e08..23c9deccf 100644 --- a/src/plugins/scripts/perl/weechat-perl.h +++ b/src/plugins/scripts/perl/weechat-perl.h @@ -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; |