Commit d5d1b1a6 authored by Yuanle Song's avatar Yuanle Song
Browse files

v0.7.3 control log output

changed some g_message to g_debug to reduce log during normal usage.
especially, do not log user's preedit_str, this could leak sensitive
user data to syslog.
parent d33de9d2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ on_handle_get_candidates(ZeroPinyinService *object,
			"Bad param");
		return TRUE;
	}
	g_message("get_candidates for preedit_str=%s fetch_size=%u",
	g_info("get_candidates for preedit_str=%s fetch_size=%u",
	       preedit_str, fetch_size);

	GVariant *result = NULL;
@@ -84,7 +84,7 @@ on_handle_delete_candidate(ZeroPinyinService *object,
	}
	guint len = g_utf8_strlen(candidate, -1);
	if (len == 1) {
		g_message("delete single character %s is a no-op", candidate);
		g_debug("delete single character %s is a no-op", candidate);
		g_dbus_method_invocation_return_value(invocation, NULL);
		return TRUE;
	}
+1 −1
Original line number Diff line number Diff line
# -*- mode: conf -*-
project('zero-pinyin-service', ['c', 'cpp'],
  version: '0.7.2',
  version: '0.7.3',
  license: 'GPL',
  default_options: [
    'warning_level=2',
+7 −7
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ get_candidates(sqlite3 *db,
	guint r = 0;
	GList *candidates = NULL;
	while (fetched_size < fetch_size && group_size > 0) {
		g_message("phrase length=%u", group_size);
		g_info("phrase length=%u", group_size);
		r = get_candidates_for_n_pinyin(db, preedit_str, pylist, group_size, fetch_size - fetched_size, &candidates);
		if (candidates) {
			GList *iter = g_list_first(candidates);
@@ -344,11 +344,11 @@ get_candidates(sqlite3 *db,
			}
			g_list_free_full(candidates, g_free);
		}
		g_message("%u candidates found", r);
		g_info("%u candidates found", r);
		fetched_size += r;
		group_size--;
	}
	g_message("returning %u candidates", fetched_size);
	g_info("returning %u candidates", fetched_size);
	g_list_free_full(pylist, g_free);
}

@@ -405,7 +405,7 @@ _update_userdb_py_phrase(sqlite3 *db,
		g_warning("INSERT candidate to userdb failed");
	} else {
		if (sqlite3_changes(db) == 1) {
			g_message("candidate %s inserted to userdb", candidate);
			g_debug("candidate %s inserted to userdb", candidate);
		}
	}
	g_string_free(sql, TRUE);
@@ -432,7 +432,7 @@ _update_userdb_py_phrase(sqlite3 *db,
		g_warning("UPDATE candidate user_freq failed");
	} else {
		if (sqlite3_changes(db) == 1) {
			g_message("candidate %s user_freq incremented", candidate);
			g_info("candidate %s user_freq incremented", candidate);
		} else {
			g_warning("UPDATE candidate user_freq failed, no match");
		}
@@ -453,7 +453,7 @@ _update_userdb_not_phrase(sqlite3 *db,
		g_warning("DELETE candidate from not_phrase failed");
	} else {
		if (sqlite3_changes(db) == 1) {
			g_message("candidate %s removed from not_phrase", candidate);
			g_debug("candidate %s removed from not_phrase", candidate);
		}
	}
	sqlite3_free(sql);
@@ -478,7 +478,7 @@ commit_candidate(sqlite3 *db,
	}
	guint len = g_utf8_strlen(candidate, -1);
	if (len <= 1) {
		g_message("commit single character %s is a no-op", candidate);
		g_info("commit single character %s is a no-op", candidate);
		return;
	}
	_update_userdb_py_phrase(db, candidate, candidate_pinyin_indices, len);