Merge lp:~miguelaraujo/mysql-proxy/loaded-plugins-logging into lp:mysql-proxy/0.8

Proposed by Miguel Araújo
Status: Merged
Approved by: Jan Kneschke
Approved revision: 1230
Merge reported by: Jan Kneschke
Merged at revision: not available
Proposed branch: lp:~miguelaraujo/mysql-proxy/loaded-plugins-logging
Merge into: lp:mysql-proxy/0.8
Diff against target: 73 lines (+24/-5)
4 files modified
plugins/cli/cli-plugin.c (+2/-2)
src/chassis-frontend.c (+14/-0)
src/chassis-frontend.h (+5/-0)
src/mysql-proxy-cli.c (+3/-3)
To merge this branch: bzr merge lp:~miguelaraujo/mysql-proxy/loaded-plugins-logging
Reviewer Review Type Date Requested Status
Jan Kneschke (community) Approve
Review via email: mp+89737@code.launchpad.net

This proposal supersedes a proposal from 2012-01-03.

Description of the change

Updated plugins chassis name value;
Added logging for the loaded plugins.

To post a comment you must log in.
Revision history for this message
Jan Kneschke (jan-kneschke) wrote : Posted in a previous version of this proposal

1) don't prefix all plugin names by "MySQL" when logging. It is up to the plugin to define its full name it wants to announce

2) remove the CHASSIS_NEWLINE from the g_critical() to get rid of the double newline. g_critical() (as all g_log() functions) always adds a newline itself.

review: Needs Fixing
Revision history for this message
Jan Kneschke (jan-kneschke) wrote : Posted in a previous version of this proposal

After a 2nd thought: stick with the old plugin names (proxy, debug, ...) and log it as:

  g_critical("plugin %s %s started", p->name, p->version);

review: Needs Fixing
1230. By Miguel Araújo

Reverted to old plugin names and altered logging message sintax

Revision history for this message
Jan Kneschke (jan-kneschke) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/cli/cli-plugin.c'
--- plugins/cli/cli-plugin.c 2010-04-06 14:26:51 +0000
+++ plugins/cli/cli-plugin.c 2012-01-23 20:08:38 +0000
@@ -556,8 +556,8 @@
556int plugin_init(chassis_plugin *p) {556int plugin_init(chassis_plugin *p) {
557 /* append the our init function to the init-hook-list */557 /* append the our init function to the init-hook-list */
558 p->magic = CHASSIS_PLUGIN_MAGIC;558 p->magic = CHASSIS_PLUGIN_MAGIC;
559 p->name = g_strdup("cli");559 p->name = g_strdup("client");
560 p->version = g_strdup("0.7.0");560 p->version = g_strdup(PACKAGE_VERSION);
561561
562 p->init = network_mysqld_cli_plugin_init;562 p->init = network_mysqld_cli_plugin_init;
563 p->get_options = network_mysqld_cli_plugin_get_options;563 p->get_options = network_mysqld_cli_plugin_get_options;
564564
=== modified file 'src/chassis-frontend.c'
--- src/chassis-frontend.c 2011-10-13 10:56:04 +0000
+++ src/chassis-frontend.c 2012-01-23 20:08:38 +0000
@@ -524,6 +524,20 @@
524 lua_close(L);524 lua_close(L);
525}525}
526526
527/**
528 * log the versions of the initialized plugins
529*/
530int chassis_frontend_log_plugin_versions(GPtrArray *plugins) {
531 guint i;
532
533 for (i = 0; i < plugins->len; i++) {
534 chassis_plugin *p = plugins->pdata[i];
535
536 g_critical("plugin %s %s started", p->name, p->version);
537 }
538
539 return 0;
540}
527541
528int chassis_frontend_write_pidfile(const char *pid_file, GError **gerr) {542int chassis_frontend_write_pidfile(const char *pid_file, GError **gerr) {
529 int fd;543 int fd;
530544
=== modified file 'src/chassis-frontend.h'
--- src/chassis-frontend.h 2010-07-07 07:57:26 +0000
+++ src/chassis-frontend.h 2012-01-23 20:08:38 +0000
@@ -151,6 +151,11 @@
151CHASSIS_API void chassis_frontend_print_lua_version();151CHASSIS_API void chassis_frontend_print_lua_version();
152152
153/**153/**
154 * log the versions of the initialized plugins
155*/
156CHASSIS_API int chassis_frontend_log_plugin_versions(GPtrArray *plugins);
157
158/**
154 * write the PID to a file159 * write the PID to a file
155 *160 *
156 * @param pid_file name of the PID file161 * @param pid_file name of the PID file
157162
=== modified file 'src/mysql-proxy-cli.c'
--- src/mysql-proxy-cli.c 2011-09-08 09:13:48 +0000
+++ src/mysql-proxy-cli.c 2012-01-23 20:08:38 +0000
@@ -564,10 +564,10 @@
564 }564 }
565 }565 }
566566
567 /* the message has to be _after_ the g_option_content_parse() to 567 /*
568 * hide from the output if the --help is asked for568 * log the versions of all loaded plugins
569 */569 */
570 g_message("%s started", PACKAGE_STRING); /* add tag to the logfile (after we opened the logfile) */570 chassis_frontend_log_plugin_versions(srv->modules);
571571
572#ifdef _WIN32572#ifdef _WIN32
573 if (chassis_win32_is_service()) chassis_win32_service_set_state(SERVICE_RUNNING, 0);573 if (chassis_win32_is_service()) chassis_win32_service_set_state(SERVICE_RUNNING, 0);

Subscribers

People subscribed via source and target branches