Skip to content

Commit

Permalink
change libevent log level, make only the libevent error to be logged.
Browse files Browse the repository at this point in the history
  • Loading branch information
winkyao committed May 14, 2015
1 parent 83b69a7 commit 7987c53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/admin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function read_query(packet)
{ name = "version",
type = proxy.MYSQL_TYPE_STRING },
}
rows[#rows + 1] = { "2.2.1" }
rows[#rows + 1] = { "2.2.2" }
elseif string.find(query:lower(), "^select%s+*%s+from%s+help$") then
fields = {
{ name = "command",
Expand Down
7 changes: 5 additions & 2 deletions src/chassis-mainloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ static void event_log_use_glib(int libevent_log_level, const char *msg) {
else if (libevent_log_level == _EVENT_LOG_MSG) glib_log_level = G_LOG_LEVEL_MESSAGE;
else if (libevent_log_level == _EVENT_LOG_WARN) glib_log_level = G_LOG_LEVEL_WARNING;
else if (libevent_log_level == _EVENT_LOG_ERR) glib_log_level = G_LOG_LEVEL_CRITICAL;

g_log(G_LOG_DOMAIN, glib_log_level, "(libevent) %s", msg);

/*only error to be logged*/
if (libevent_log_level == _EVENT_LOG_ERR) {
g_log(G_LOG_DOMAIN, glib_log_level, "(libevent) %s", msg);
}
}


Expand Down

0 comments on commit 7987c53

Please sign in to comment.