Improved debug messages

This commit is contained in:
Jesse van den Kieboom 2005-11-06 16:38:51 +00:00
parent c48359a18c
commit e4bc5e7360
16 changed files with 69 additions and 69 deletions

View File

@ -403,7 +403,7 @@ gm_preferences_dialog_save_editor_color(GtkTreeModel *model,
style->italic, style->underline,
style->strikethrough);
debug_msg(1, "GmPreferencesDialog.SaveEditorColor %s to %s", opt_key,
gm_debug_msg(DEBUG_DEFAULT, "GmPreferencesDialog.SaveEditorColor %s to %s", opt_key,
opt_value);
gm_options_set(options, opt_key, opt_value);

View File

@ -212,7 +212,7 @@ gm_scripts_dialog_editor_load(SelectionInfo *info) {
gm_scripts_dialog_set_status(msg);
g_free(msg);
} else {
debug_msg(1, "GmScript.EditorLoad: file (%s) could not be read: %s",
gm_debug_msg(DEBUG_DEFAULT, "GmScript.EditorLoad: file (%s) could not be read: %s",
scripts_dialog->current_edit, strerror(errno));
}
} else {

View File

@ -922,7 +922,7 @@ on_combo_box_type_changed(GtkComboBox *widget, ComboBoxTypeData *tdata) {
tdata->data = NULL;
}
} else {
debug_msg(0, "No active iter!");
gm_debug_msg(DEBUG_ALWAYS, "No active iter!");
}
}

View File

@ -306,7 +306,7 @@ gm_app_load_worlds(GmApp *app, gboolean autoload) {
}
}
} else {
debug_msg(0, "Nee: %s", path);
gm_debug_msg(DEBUG_ALWAYS, "Nee: %s", path);
}
g_free(path);
@ -314,7 +314,7 @@ gm_app_load_worlds(GmApp *app, gboolean autoload) {
g_dir_close(handle);
} else {
debug_msg(1, "GmApp.load_worlds: failed to open worlds path %s",
gm_debug_msg(DEBUG_DEFAULT, "GmApp.load_worlds: failed to open worlds path %s",
app->priv->path);
}
}

View File

@ -144,19 +144,19 @@ gm_net_clean_disconnection(GmNet *net) {
GError *err = NULL;
if (!net->priv->channel) {
debug_msg(1, "GmNet.CleanDisconnection: NOT clean for %d",
gm_debug_msg(DEBUG_DEFAULT, "GmNet.CleanDisconnection: NOT clean for %d",
net->priv->socket);
return;
}
debug_msg(1, "GmNet.CleanDisconnection: clean disconnect for %d",
gm_debug_msg(DEBUG_DEFAULT, "GmNet.CleanDisconnection: clean disconnect for %d",
net->priv->socket);
// Shutdown the channel
g_io_channel_shutdown(net->priv->channel, TRUE, &err);
if (err) {
debug_msg(1, "GmNet.CleanDisconnection: error on channel shutdown: "
gm_debug_msg(DEBUG_DEFAULT, "GmNet.CleanDisconnection: error on channel shutdown: "
"%s", err->message);
g_error_free(err);
err = NULL;
@ -178,7 +178,7 @@ gm_net_dirty_disconnection(GmNet *net, int err) {
gchar *msg;
// Pff, stupid, we print a message and pass it on to clean_disconnection
debug_msg(1, "GmNet.DirtyDisconnection: dirty disconnect %d",
gm_debug_msg(DEBUG_DEFAULT, "GmNet.DirtyDisconnection: dirty disconnect %d",
net->priv->socket);
msg = g_strdup_printf(_("Connection lost... (%s)"), strerror(err));
@ -250,7 +250,7 @@ gm_net_connect_next(GmNet *net) {
} else {
if ((ret = getnameinfo(tmp->ai_addr, tmp->ai_addrlen, host, NI_MAXHOST,
port, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
debug_msg(1, "GmNet.ConnectNext: getnameinfo error: %s",
gm_debug_msg(DEBUG_DEFAULT, "GmNet.ConnectNext: getnameinfo error: %s",
gai_strerror(ret));
gm_net_connect_failed(net, (gchar *)gai_strerror(ret), ret);
return;
@ -379,11 +379,11 @@ gm_net_connect(GmNet *net, const gchar *host, const gchar *port) {
hint.ai_socktype = SOCK_STREAM;
hint.ai_protocol = IPPROTO_TCP;
debug_msg(1, "GmNet.Connect: getaddrinfo: %s : %s", shost, sport);
gm_debug_msg(DEBUG_DEFAULT, "GmNet.Connect: getaddrinfo: %s : %s", shost, sport);
if ((ret = getaddrinfo(shost, sport, &hint, &(net->priv->addr))) != 0) {
net->priv->addr = NULL;
debug_msg(1, "GmNet.Connect: getaddrinfo failed: %s", gai_strerror(ret));
gm_debug_msg(DEBUG_DEFAULT, "GmNet.Connect: getaddrinfo failed: %s", gai_strerror(ret));
gm_net_connect_failed(net, (gchar *)gai_strerror(ret), ret);
return;
}
@ -422,7 +422,7 @@ gm_net_send(GmNet *net, gchar *text) {
fd_set connect_set;
if (net->priv->state == GM_NET_STATE_CONNECTED) {
debug_msg(1, "GmNet.Send: %s", text);
gm_debug_msg(DEBUG_DEFAULT, "GmNet.Send: %s", text);
if ((result = send(net->priv->socket, text, strlen(text), 0)) == -1
&& (errno == EAGAIN || errno == EWOULDBLOCK)) {
@ -432,13 +432,13 @@ gm_net_send(GmNet *net, gchar *text) {
// Wait for sending to be done
select(net->priv->socket + 1, NULL, &connect_set, NULL, NULL);
} else if (result == -1) {
debug_msg(1, "GmNet.Send: error on sending line: %s", strerror(errno));
gm_debug_msg(DEBUG_DEFAULT, "GmNet.Send: error on sending line: %s", strerror(errno));
gm_net_dirty_disconnection(net, errno);
}
} else {
g_signal_emit(net, net_signals[NET_ERROR], 0, _("Not connected"),
GM_NET_ERROR);
debug_msg(1, "GmNet.Send: not connected!");
gm_debug_msg(DEBUG_DEFAULT, "GmNet.Send: not connected!");
}
}
@ -468,14 +468,14 @@ on_gm_net_input_recv(GIOChannel * source, GIOCondition condition, GmNet *net) {
}
if (net->priv->state != GM_NET_STATE_CONNECTED) {
debug_msg(1, "GmNet.OnInputRecv: not connected!");
gm_debug_msg(DEBUG_DEFAULT, "GmNet.OnInputRecv: not connected!");
return FALSE;
}
// Break the received line by newline (skip \r)
len = recv(net->priv->socket, lbuf, MAX_RECV_BUF - 2, 0);
debug_msg(1, "GmNet.OnInputRecv: received %d bytes", len);
gm_debug_msg(DEBUG_DEFAULT, "GmNet.OnInputRecv: received %d bytes", len);
if (len < 1) {
// Disconnected, either clean or dirty

View File

@ -134,7 +134,7 @@ gm_options_get_int(GmOptions *options, const gchar *key) {
void
gm_options_save_value(gchar *key, gchar *value, FILE *f) {
debug_msg(1, "GmOptions.SaveValue: saving %s, %s", key, value);
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.SaveValue: saving %s, %s", key, value);
fprintf(f, "%s=%s\n", key, value);
}
@ -148,7 +148,7 @@ gm_options_save(GmOptions *options) {
f = fopen(options->priv->filepath, "w");
debug_msg(1, "GmOptions.save: saving options (%s)!", options->priv->filepath);
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.save: saving options (%s)!", options->priv->filepath);
if (f) {
g_hash_table_foreach(options->priv->options,
@ -157,7 +157,7 @@ gm_options_save(GmOptions *options) {
fclose(f);
chmod(options->priv->filepath, 0660);
} else {
debug_msg(1, "GmOptions.save: couldn't open option file for saving: %s",
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.save: couldn't open option file for saving: %s",
strerror(errno));
}
}
@ -176,7 +176,7 @@ gm_options_load(GmOptions *options, const char *filename) {
gchar **keyvalue, line[1024];
int i;
debug_msg(1, "GmOptions.load: loading options (%s)!", filename);
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.load: loading options (%s)!", filename);
if ((f = fopen(filename, "r")) != NULL) {
i = 0;
@ -189,10 +189,10 @@ gm_options_load(GmOptions *options, const char *filename) {
// This will return at least 1 element, at most 2, we need 2
if (strncmp(keyvalue[0], "#", 1) != 0) { // Commented lines, well ignore them too
if (keyvalue[1] != NULL) {
debug_msg(1, "GmOptions.load: adding %s, %s", keyvalue[0], keyvalue[1]);
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.load: adding %s, %s", keyvalue[0], keyvalue[1]);
gm_options_set(options, keyvalue[0], keyvalue[1]);
} else {
debug_msg(1, "GmOptions.load: wrong syntax of options "
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.load: wrong syntax of options "
"line in %s line %d", filename, i);
}
}
@ -203,7 +203,7 @@ gm_options_load(GmOptions *options, const char *filename) {
fclose(f);
} else {
debug_msg(1, "GmOptions.load: could not retrieve contents of file "
gm_debug_msg(DEBUG_DEFAULT, "GmOptions.load: could not retrieve contents of file "
"%s (%s)", filename, strerror(errno));
}

View File

@ -83,7 +83,7 @@ gm_pixbuf_create(const gchar * filename, int width, int height) {
pathname = gm_pixbuf_find(filename);
if (!pathname) {
debug_msg(1, "gm_pixbuf_create: couldn't find pixbuf file: %s", filename);
gm_debug_msg(DEBUG_DEFAULT, "gm_pixbuf_create: couldn't find pixbuf file: %s", filename);
return NULL;
}
@ -96,7 +96,7 @@ gm_pixbuf_create(const gchar * filename, int width, int height) {
}
if (!pixbuf) {
debug_msg(1, "gm_pixbuf_create: failed to load pixbuf from file: %s: %s\n",
gm_debug_msg(DEBUG_DEFAULT, "gm_pixbuf_create: failed to load pixbuf from file: %s: %s\n",
pathname, error->message);
g_error_free(error);
error = NULL;

View File

@ -310,7 +310,7 @@ gm_scripts_rb_error(GmScripts *scripts) {
lasterr = rb_gv_get("$!");
err = RSTRING(rb_obj_as_string(lasterr))->ptr;
debug_msg(1, "GmScripts.Error: Error while executing Ruby code: %s",
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.Error: Error while executing Ruby code: %s",
err);
msg = g_strdup_printf(_("Error in execution: %s"), err);
@ -318,12 +318,12 @@ gm_scripts_rb_error(GmScripts *scripts) {
g_free(msg);
ary = rb_funcall(ruby_errinfo, rb_intern("backtrace"), 0);
debug_msg(1, "GmScripts.Error: Ruby backtrace:");
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.Error: Ruby backtrace:");
g_signal_emit(scripts, gm_scripts_signals[ERROR], 0,
_("Ruby backtrace:"));
for (c = 0; c < RARRAY(ary)->len; c++) {
debug_msg(1, "GmScripts.Error: \tfrom %s",
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.Error: \tfrom %s",
RSTRING(RARRAY(ary)->ptr[c])->ptr);
msg = g_strdup_printf(_("\tfrom %s"),
@ -418,7 +418,7 @@ gm_scripts_run(GmScripts *scripts, GmWorld *world, gchar *name, gchar *argstr) {
VALUE
gm_scripts_rb_register_func_old(int argc, VALUE *argv) {
debug_msg(1, "GmScripts.RegisterFunc: This is the deprecated way to "
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.RegisterFunc: This is the deprecated way to "
"register functions is does no longer work. Use $scripts.register "
"instead.");
@ -430,7 +430,7 @@ gm_scripts_register_functions(GmScripts *scripts) {
gchar *msg;
VALUE rbScripts;
debug_msg(1, "GmScripts.RegisterFunctions: registering functions in %s",
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.RegisterFunctions: registering functions in %s",
scripts->priv->loading->filename);
msg = g_strdup_printf(_("Registering functions from '%s'"),
@ -471,7 +471,7 @@ gm_scripts_remove_file(GmScripts *scripts, const gchar *uri) {
if (strcmp(script->filename, uri) == 0) {
scripts->priv->files = g_list_remove(scripts->priv->files, script);
debug_msg(1, "GmScripts.RemoveFile: Removing scripts from `%s'",
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.RemoveFile: Removing scripts from `%s'",
script->filename);
g_signal_emit(scripts, gm_scripts_signals[SCRIPT_REMOVED], 0,
script);
@ -495,7 +495,7 @@ gm_scripts_add_file(GmScripts *scripts, const gchar *uri) {
if (strcmp(script->filename, uri) == 0) {
msg = g_strdup_printf(_("File `%s' already loaded"), uri);
debug_msg(1, "GmScripts.AddFile: %s", msg);
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.AddFile: %s", msg);
g_signal_emit(scripts, gm_scripts_signals[ERROR], 0, msg);
g_free(msg);
@ -504,7 +504,7 @@ gm_scripts_add_file(GmScripts *scripts, const gchar *uri) {
}
msg = g_strdup_printf(_("File `%s' added"), uri);
debug_msg(1, "GmScripts.AddFile: %s", msg);
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.AddFile: %s", msg);
g_free(msg);
script = g_new0(GmScript, 1);
@ -808,14 +808,14 @@ gm_scripts_rb_scripts_register(int argc, VALUE *argv, VALUE self) {
if (gm_scripts_add(scripts, name, fname, description)) {
msg = g_strdup_printf(_("Register function '%s' from '%s'"), name,
scripts->priv->loading->filename);
debug_msg(1, "GmScripts.RbScriptsRegister: Adding script function "
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.RbScriptsRegister: Adding script function "
"%s from %s", name, scripts->priv->loading->filename);
g_signal_emit(scripts, gm_scripts_signals[MESSAGE], 0, msg);
g_free(msg);
return Qtrue;
} else {
msg = g_strdup_printf(_("Script '%s' is already defined"), name);
debug_msg(1, "GmScripts.RbScriptsRegister: Script function %s "
gm_debug_msg(DEBUG_DEFAULT, "GmScripts.RbScriptsRegister: Script function %s "
"already defined!", name);
g_signal_emit(scripts, gm_scripts_signals[ERROR], 0, msg);
g_free(msg);

View File

@ -133,7 +133,7 @@ gm_string_catn(gchar *str, gchar *add, guint n) {
}
if ((newstr = (gchar *) realloc(str, (relen + n + 1) * sizeof(gchar))) == NULL) {
debug_msg(1, "mystring_catn: REALLOC FAILED!");
gm_debug_msg(DEBUG_DEFAULT, "mystring_catn: REALLOC FAILED!");
return str;
} else {
if (relen == 0) {

View File

@ -345,7 +345,7 @@ gm_fetch_progress(GnomeVFSAsyncHandle *handle,
if (info->status == GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE) {
name = gnome_vfs_get_local_path_from_uri(info->target_name);
debug_msg(1, "gnoemoe_fetch_progress: asking for overwriting %s: yes", name);
gm_debug_msg(DEBUG_DEFAULT, "gnoemoe_fetch_progress: asking for overwriting %s: yes", name);
g->prev_status = GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE;
return GNOME_VFS_XFER_OVERWRITE_ACTION_REPLACE;
@ -354,7 +354,7 @@ gm_fetch_progress(GnomeVFSAsyncHandle *handle,
err = gnome_vfs_result_to_string(info->vfs_status);
gdk_threads_enter();
debug_msg(1, "gnoemoe_fetch_progress: error for %s: %s", name, err);
gm_debug_msg(DEBUG_DEFAULT, "gnoemoe_fetch_progress: error for %s: %s", name, err);
g->cb(g, g->user_data);
gdk_threads_leave();
@ -500,7 +500,7 @@ gm_read_file(const gchar *fname, gboolean readall, OpenLogProgress func, gpointe
return str;
} else {
debug_msg(1, "support_read_file: file (%s) could not be read: %s",
gm_debug_msg(DEBUG_DEFAULT, "support_read_file: file (%s) could not be read: %s",
fname, strerror(errno));
return NULL;
}

View File

@ -309,7 +309,7 @@ gm_triggers_new_from_file(gchar *filename) {
xmlNodePtr cur;
if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
debug_msg(1, "GmTriggers.NewFromFile: Trigger file does not exist");
gm_debug_msg(DEBUG_DEFAULT, "GmTriggers.NewFromFile: Trigger file does not exist");
return trg;
}
@ -318,7 +318,7 @@ gm_triggers_new_from_file(gchar *filename) {
doc = xmlParseFile(filename);
if (doc == NULL) {
debug_msg(1, "GmTriggers.NewFromFile: Error on parsing triggers");
gm_debug_msg(DEBUG_DEFAULT, "GmTriggers.NewFromFile: Error on parsing triggers");
return trg;
}
@ -330,7 +330,7 @@ gm_triggers_new_from_file(gchar *filename) {
}
if (xmlStrcmp(cur->name, (const xmlChar *)("triggers"))) {
debug_msg(1, "GmTriggers.NewFromFile: invalid root node");
gm_debug_msg(DEBUG_DEFAULT, "GmTriggers.NewFromFile: invalid root node");
xmlFreeDoc(doc);
return trg;
}

View File

@ -281,7 +281,7 @@ gm_world_load_input_history(GmWorld *world) {
filename = g_strconcat(world->priv->path, G_DIR_SEPARATOR_S, "history",
NULL);
debug_msg(1, "GmWorld.LoadInputHistory: loading history (%s)!", filename);
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.LoadInputHistory: loading history (%s)!", filename);
if ((f = fopen(filename, "r")) != NULL) {
str = g_string_new("");
@ -300,7 +300,7 @@ gm_world_load_input_history(GmWorld *world) {
g_string_free(str, TRUE);
fclose(f);
} else {
debug_msg(1, "GmWorld.LoadInputHistory: could not retrieve contents of "
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.LoadInputHistory: could not retrieve contents of "
"file %s (%s)", filename, strerror(errno));
}
@ -321,7 +321,7 @@ gm_world_save_input_history(GmWorld *world) {
f = fopen(filename, "w");
if (f) {
debug_msg(1, "GmWorld.SaveInputHistory: saving input history to %s",
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.SaveInputHistory: saving input history to %s",
filename);
for (elem = world->priv->history; elem; elem = elem->next) {
@ -332,7 +332,7 @@ gm_world_save_input_history(GmWorld *world) {
chmod(filename, 0660);
} else {
debug_msg(1, "GmWorld.SaveInputHistory: couldn't open history file (%s)"
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.SaveInputHistory: couldn't open history file (%s)"
" for saving: %s", filename, strerror(errno));
}
@ -361,10 +361,10 @@ gm_world_new(gchar *path) {
if (path != NULL) {
options_path = g_strconcat(path, "/settings", NULL);
debug_msg(1, "GmWorld.new: creating new world for %s", path);
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.new: creating new world for %s", path);
world->priv->path = g_strdup(path);
debug_msg(1, "GmWorld.new: creating default world settings for %s", path);
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.new: creating default world settings for %s", path);
gm_options_load(world->priv->options, options_path);
if (strlen(gm_options_get(world->priv->options, "charset")) == 0) {
@ -668,7 +668,7 @@ gm_world_process_input(GmWorld *world, gchar *text) {
argstr = g_strdup(space + 1);
}
debug_msg(1, "GmWorld.ProcessInput: Trying script %s (%s)", script,
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.ProcessInput: Trying script %s (%s)", script,
argstr);
script_ran = gm_scripts_run(gm_app_scripts(gm_app_instance()),
world, script, argstr);
@ -722,7 +722,7 @@ gm_world_sendln(GmWorld *world, gchar *text) {
gm_options_get(world->priv->options, "charset"), "?");
if (!normal) {
debug_msg(1, "GmWorld.Send: conversion failed!");
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.Send: conversion failed!");
normal = g_strdup(text);
}
@ -821,7 +821,7 @@ on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
gm_options_get(world->priv->options, "charset"), "?");
if (!utext) {
debug_msg(1, "GmWorld.NetBytesRecv: conversion failed!");
gm_debug_msg(DEBUG_DEFAULT, "GmWorld.NetBytesRecv: conversion failed!");
utext = g_strndup(text, len);
}

View File

@ -145,7 +145,7 @@ gm_mcp_negotiate_fix_overrides(GmMcpNegotiate *package) {
name = (gchar *)(over->data);
if ((pover = gm_mcp_negotiate_find_package(package, name))) {
debug_msg(2, "GmMcpNegotiate.FixOverrides: package %s "
gm_debug_msg(DEBUG_MCP, "GmMcpNegotiate.FixOverrides: package %s "
"overrides %s", pinfo->klass->name, pover->klass->name);
package->priv->packages = g_list_remove(
package->priv->packages, pover);
@ -171,7 +171,7 @@ gm_mcp_negotiate_fix_depends(GmMcpNegotiate *package) {
name = (gchar *)(dep->data);
if (!(pdep = gm_mcp_negotiate_find_package(package, name))) {
debug_msg(2, "GmMcpNegotiate.FixDepends: package %s depends "
gm_debug_msg(DEBUG_MCP, "GmMcpNegotiate.FixDepends: package %s depends "
"on %s, but %s is not supported", pinfo->klass->name,
name, name);
@ -256,7 +256,7 @@ gm_mcp_negotiate_handle_simple(GmMcpPackage *package, gchar *suffix,
g_free(cmax);
if (version > 0.0) {
debug_msg(2, "GmMcpNegotiate.HandleSimple: %s, "
gm_debug_msg(DEBUG_MCP, "GmMcpNegotiate.HandleSimple: %s, "
"package is supported", pname);
pinfo = g_new(PackageInfo, 1);
pinfo->klass = pklass;
@ -265,11 +265,11 @@ gm_mcp_negotiate_handle_simple(GmMcpPackage *package, gchar *suffix,
negotiate->priv->packages = g_list_append(
negotiate->priv->packages, pinfo);
} else {
debug_msg(2, "GmMcpNegotiate.HandleSimple: %s, package "
gm_debug_msg(DEBUG_MCP, "GmMcpNegotiate.HandleSimple: %s, package "
"supported but wrong version!", pname);
}
} else {
debug_msg(2, "GmMcpNegotiate.HandleSimple: %s, package is not "
gm_debug_msg(DEBUG_MCP, "GmMcpNegotiate.HandleSimple: %s, package is not "
"supported!", pname);
}
} else if (strcasecmp(suffix, "end") == 0) {

View File

@ -80,7 +80,7 @@ gm_mcp_session_handle_open(GmMcpSession *session, gchar *line) {
double min_v, max_v, version;
if (!(min_version && max_version)) {
debug_msg(2, "GmMcpSession.HandleOpen: invalid opening, minVersion OR "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOpen: invalid opening, minVersion OR "
"maxVersion not found!");
return;
}
@ -108,7 +108,7 @@ gm_mcp_session_handle_open(GmMcpSession *session, gchar *line) {
p = gm_mcp_session_create_package(session, pklass,
pklass->max_version);
} else {
debug_msg(2, "GmMcpSession.HandleOpen: mcp server version does not "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOpen: mcp server version does not "
"match client version!");
}
}
@ -370,7 +370,7 @@ gm_mcp_session_create_package(GmMcpSession *session, GmMcpPackageClass *klass,
package);
return package;
} else {
debug_msg(2, "GmMcpSession.CreatePackage: package (%s) is already "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.CreatePackage: package (%s) is already "
"registered for %s", klass->name,
gm_options_get(gm_world_options(session->priv->world), "name"));
return NULL;
@ -398,7 +398,7 @@ gm_mcp_session_handle_oob(GmMcpSession *session, gchar *line) {
gchar *suffix;
gchar const *value, *full;
debug_msg(2, "GmMcpSession.HandleOob: %s", line);
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: %s", line);
info.fields = NULL;
info.authkey = NULL;
@ -408,7 +408,7 @@ gm_mcp_session_handle_oob(GmMcpSession *session, gchar *line) {
gm_mcp_session_handle_open(session, line + 3);
} else if (session->priv->version == -1) {
// No session, drop
debug_msg(2, "GmMcpSession.HandleOob: No session found for %s, "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: No session found for %s, "
"ignoring out of bound command!", gm_options_get(
gm_world_options(session->priv->world), "name"));
} else if (strncmp(line, "* ", 2) == 0) {
@ -441,13 +441,13 @@ gm_mcp_session_handle_oob(GmMcpSession *session, gchar *line) {
session->priv->multiline = g_list_append(
session->priv->multiline, minfo);
debug_msg(2, "GmMcpSession.HandleOob: multiline "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: multiline "
"opening detected and stored "
"(data_tag = %s, key = %s)",
minfo->data_tag,
minfo->key);
} else {
debug_msg(2, "GmMcpSession.HandleOob: multiline "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: multiline "
"opening detected, but no _data-tag specified, "
"ignore message");
}
@ -465,16 +465,16 @@ gm_mcp_session_handle_oob(GmMcpSession *session, gchar *line) {
info.fields);
}
} else {
debug_msg(2, "GmMcpSession.HandleOob: unsupported package "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: unsupported package "
"%s, ignore message", info.name);
}
} else {
debug_msg(2, "GmMcpSession.HandleOob: invalid authentication "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: invalid authentication "
"key %s instead of %s, ignore message", info.authkey,
session->priv->authkey);
}
} else {
debug_msg(2, "GmMcpSession.HandleOob: invalid message "
gm_debug_msg(DEBUG_MCP, "GmMcpSession.HandleOob: invalid message "
"(could not parse), ignore message");
}

View File

@ -165,7 +165,7 @@ gm_app_view_create_menu(GmAppView *view) {
PACKAGE_DATA_DIR "/" PACKAGE "/ui/gm-ui.xml", &error);
if (error) {
debug_msg(1, "Could not merge UI file");
gm_debug_msg(DEBUG_DEFAULT, "Could not merge UI file");
g_error_free(error);
}

View File

@ -724,7 +724,7 @@ gm_world_text_view_insert(GmWorldTextView *view, const gchar *text) {
}
}
debug_msg(1, "GmWorldTextView.Insert: %s", new_line->str);
gm_debug_msg(DEBUG_DEFAULT, "GmWorldTextView.Insert: %s", new_line->str);
gtk_text_buffer_get_end_iter(buffer, &started);
start_mark = gtk_text_buffer_create_mark(buffer, "last-insertion",
&started, TRUE);