mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-15 20:25:12 +01:00
new function g_log_set_always_fatal() to set an additional fatal_mask for
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org> * glib.h: * gmessages.c: new function g_log_set_always_fatal() to set an additional fatal_mask for log levels that are considered to be fatal globally (required by gtk). since this mask is not domain-associated, it is restricted to the log levels, introduced by glib itself. * gmem.c: * grel.c: * gtree.c (g_tree_node_check): don't use g_print() calls for informational/debugging output, but log all this stuff through g_log() with G_LOG_LEVEL_INFO. libraries shouldn't use printf(), g_print() or g_printerr() at all.
This commit is contained in:
parent
d7f2383949
commit
e1f0fb0c1e
16
ChangeLog
16
ChangeLog
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
Tue Aug 18 04:40:17 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib.h:
|
||||
* gmessages.c: new function g_log_set_always_fatal() to set an
|
||||
additional fatal_mask for log levels that are considered to be fatal
|
||||
globally (required by gtk). since this mask is not domain-associated,
|
||||
it is restricted to the log levels, introduced by glib itself.
|
||||
|
||||
* gmem.c:
|
||||
* grel.c:
|
||||
* gtree.c (g_tree_node_check):
|
||||
don't use g_print() calls for informational/debugging output,
|
||||
but log all this stuff through g_log() with G_LOG_LEVEL_INFO.
|
||||
libraries shouldn't use printf(), g_print() or g_printerr() at all.
|
||||
|
||||
Tue Aug 18 02:46:44 1998 Tim Janik <timj@gtk.org>
|
||||
|
||||
|
||||
* glib.h (__STRICT_ANSI__): if __STRICT_ANSI__ is defined, make
|
||||
`inline' a noop, since strict ANSI rules don't permit `inline'.
|
||||
|
||||
|
1
glib.h
1
glib.h
@ -959,6 +959,7 @@ void g_logv (const gchar *log_domain,
|
||||
va_list *args2);
|
||||
GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain,
|
||||
GLogLevelFlags fatal_mask);
|
||||
GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
|
||||
#ifndef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN (NULL)
|
||||
#endif /* G_LOG_DOMAIN */
|
||||
|
@ -959,6 +959,7 @@ void g_logv (const gchar *log_domain,
|
||||
va_list *args2);
|
||||
GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain,
|
||||
GLogLevelFlags fatal_mask);
|
||||
GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
|
||||
#ifndef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN (NULL)
|
||||
#endif /* G_LOG_DOMAIN */
|
||||
|
18
glib/gmem.c
18
glib/gmem.c
@ -332,13 +332,15 @@ g_mem_profile (void)
|
||||
|
||||
for (i = 0; i < 4095; i++)
|
||||
if (allocations[i] > 0)
|
||||
g_print ("%lu allocations of %d bytes\n", allocations[i], i + 1);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"%lu allocations of %d bytes\n", allocations[i], i + 1);
|
||||
|
||||
if (allocations[4095] > 0)
|
||||
g_print ("%lu allocations of greater than 4095 bytes\n", allocations[4095]);
|
||||
g_print ("%lu bytes allocated\n", allocated_mem);
|
||||
g_print ("%lu bytes freed\n", freed_mem);
|
||||
g_print ("%lu bytes in use\n", allocated_mem - freed_mem);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"%lu allocations of greater than 4095 bytes\n", allocations[4095]);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes allocated\n", allocated_mem);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes freed\n", freed_mem);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes in use\n", allocated_mem - freed_mem);
|
||||
#endif /* ENABLE_MEM_PROFILE */
|
||||
}
|
||||
|
||||
@ -727,7 +729,9 @@ g_mem_chunk_print (GMemChunk *mem_chunk)
|
||||
mem_areas = mem_areas->next;
|
||||
}
|
||||
|
||||
g_print ("%s: %ld bytes using %d mem areas\n", rmem_chunk->name, mem, rmem_chunk->num_mem_areas);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"%s: %ld bytes using %d mem areas\n",
|
||||
rmem_chunk->name, mem, rmem_chunk->num_mem_areas);
|
||||
}
|
||||
|
||||
void
|
||||
@ -744,7 +748,7 @@ g_mem_chunk_info (void)
|
||||
mem_chunk = mem_chunk->next;
|
||||
}
|
||||
|
||||
g_print ("%d mem chunks\n", count);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%d mem chunks\n", count);
|
||||
|
||||
mem_chunk = mem_chunks;
|
||||
while (mem_chunk)
|
||||
|
@ -52,6 +52,7 @@ extern gchar* g_vsprintf (const gchar *fmt,
|
||||
/* --- variables --- */
|
||||
const gchar *g_log_domain_glib = "GLib";
|
||||
static GLogDomain *g_log_domains = NULL;
|
||||
static GLogLevelFlags g_log_always_fatal = G_LOG_FATAL_MASK;
|
||||
static GPrintFunc glib_print_func = NULL;
|
||||
static GPrintFunc glib_printerr_func = NULL;
|
||||
static GErrorFunc glib_error_func = NULL;
|
||||
@ -140,6 +141,24 @@ g_log_domain_get_handler (GLogDomain *domain,
|
||||
return g_log_default_handler;
|
||||
}
|
||||
|
||||
GLogLevelFlags
|
||||
g_log_set_always_fatal (GLogLevelFlags fatal_mask)
|
||||
{
|
||||
GLogLevelFlags old_mask;
|
||||
|
||||
/* restrict the global mask to levels that are known to glib */
|
||||
fatal_mask &= (1 << G_LOG_LEVEL_USER_SHIFT) - 1;
|
||||
/* force errors to be fatal */
|
||||
fatal_mask |= G_LOG_LEVEL_ERROR;
|
||||
/* remove bogus flag */
|
||||
fatal_mask &= ~G_LOG_FLAG_FATAL;
|
||||
|
||||
old_mask = g_log_always_fatal;
|
||||
g_log_always_fatal = fatal_mask;
|
||||
|
||||
return old_mask;
|
||||
}
|
||||
|
||||
GLogLevelFlags
|
||||
g_log_set_fatal_mask (const gchar *log_domain,
|
||||
GLogLevelFlags fatal_mask)
|
||||
@ -271,7 +290,8 @@ g_logv (const gchar *log_domain,
|
||||
if (g_log_depth++)
|
||||
test_level |= G_LOG_FLAG_RECURSION;
|
||||
|
||||
if (((domain ? domain->fatal_mask : G_LOG_FATAL_MASK) & test_level) != 0)
|
||||
if ((((domain ? domain->fatal_mask : G_LOG_FATAL_MASK) | g_log_always_fatal) &
|
||||
test_level) != 0)
|
||||
test_level |= G_LOG_FLAG_FATAL;
|
||||
log_func = g_log_domain_get_handler (domain, test_level, &data);
|
||||
log_func (log_domain, test_level, buffer, data);
|
||||
|
19
glib/grel.c
19
glib/grel.c
@ -250,7 +250,7 @@ g_relation_delete (GRelation *relation,
|
||||
|
||||
g_hash_table_destroy (key_table);
|
||||
|
||||
/* @@@ Remove empty hash tables. */
|
||||
/* @@@ FIXME: Remove empty hash tables. */
|
||||
|
||||
return count - rel->count;
|
||||
}
|
||||
@ -376,20 +376,23 @@ g_relation_print_one (gpointer tuple_key,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint i;
|
||||
GString *gstring;
|
||||
GRealRelation* rel = (GRealRelation*) user_data;
|
||||
gpointer* tuples = (gpointer*) tuple_value;
|
||||
|
||||
g_print ("[");
|
||||
gstring = g_string_new ("[");
|
||||
|
||||
for (i = 0; i < rel->fields; i += 1)
|
||||
{
|
||||
g_print ("%p", tuples[i]);
|
||||
g_string_sprintfa (gstring, "%p", tuples[i]);
|
||||
|
||||
if (i < (rel->fields - 1))
|
||||
g_print (",");
|
||||
g_string_append (gstring, ",");
|
||||
}
|
||||
|
||||
g_print ("]\n");
|
||||
g_string_append (gstring, "]");
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, gstring->str);
|
||||
g_string_free (gstring, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -400,7 +403,7 @@ g_relation_print_index (gpointer tuple_key,
|
||||
GRealRelation* rel = (GRealRelation*) user_data;
|
||||
GHashTable* table = (GHashTable*) tuple_value;
|
||||
|
||||
g_print ("*** key %p\n", tuple_key);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "*** key %p", tuple_key);
|
||||
|
||||
g_hash_table_foreach (table,
|
||||
g_relation_print_one,
|
||||
@ -413,7 +416,7 @@ g_relation_print (GRelation *relation)
|
||||
gint i;
|
||||
GRealRelation* rel = (GRealRelation*) relation;
|
||||
|
||||
g_print ("*** all tuples (%d)\n", rel->count);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "*** all tuples (%d)", rel->count);
|
||||
|
||||
g_hash_table_foreach (rel->all_tuples,
|
||||
g_relation_print_one,
|
||||
@ -424,7 +427,7 @@ g_relation_print (GRelation *relation)
|
||||
if (rel->hashed_tuple_tables[i] == NULL)
|
||||
continue;
|
||||
|
||||
g_print ("*** index %d\n", i);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "*** index %d", i);
|
||||
|
||||
g_hash_table_foreach (rel->hashed_tuple_tables[i],
|
||||
g_relation_print_index,
|
||||
|
@ -712,7 +712,8 @@ g_tree_node_check (GTreeNode *node)
|
||||
|
||||
balance = right_height - left_height;
|
||||
if (balance != node->balance)
|
||||
g_print ("g_tree_node_check: failed: %d ( %d )\n",
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"g_tree_node_check: failed: %d ( %d )\n",
|
||||
balance, node->balance);
|
||||
|
||||
if (node->left)
|
||||
|
18
gmem.c
18
gmem.c
@ -332,13 +332,15 @@ g_mem_profile (void)
|
||||
|
||||
for (i = 0; i < 4095; i++)
|
||||
if (allocations[i] > 0)
|
||||
g_print ("%lu allocations of %d bytes\n", allocations[i], i + 1);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"%lu allocations of %d bytes\n", allocations[i], i + 1);
|
||||
|
||||
if (allocations[4095] > 0)
|
||||
g_print ("%lu allocations of greater than 4095 bytes\n", allocations[4095]);
|
||||
g_print ("%lu bytes allocated\n", allocated_mem);
|
||||
g_print ("%lu bytes freed\n", freed_mem);
|
||||
g_print ("%lu bytes in use\n", allocated_mem - freed_mem);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"%lu allocations of greater than 4095 bytes\n", allocations[4095]);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes allocated\n", allocated_mem);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes freed\n", freed_mem);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%lu bytes in use\n", allocated_mem - freed_mem);
|
||||
#endif /* ENABLE_MEM_PROFILE */
|
||||
}
|
||||
|
||||
@ -727,7 +729,9 @@ g_mem_chunk_print (GMemChunk *mem_chunk)
|
||||
mem_areas = mem_areas->next;
|
||||
}
|
||||
|
||||
g_print ("%s: %ld bytes using %d mem areas\n", rmem_chunk->name, mem, rmem_chunk->num_mem_areas);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"%s: %ld bytes using %d mem areas\n",
|
||||
rmem_chunk->name, mem, rmem_chunk->num_mem_areas);
|
||||
}
|
||||
|
||||
void
|
||||
@ -744,7 +748,7 @@ g_mem_chunk_info (void)
|
||||
mem_chunk = mem_chunk->next;
|
||||
}
|
||||
|
||||
g_print ("%d mem chunks\n", count);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "%d mem chunks\n", count);
|
||||
|
||||
mem_chunk = mem_chunks;
|
||||
while (mem_chunk)
|
||||
|
22
gmessages.c
22
gmessages.c
@ -52,6 +52,7 @@ extern gchar* g_vsprintf (const gchar *fmt,
|
||||
/* --- variables --- */
|
||||
const gchar *g_log_domain_glib = "GLib";
|
||||
static GLogDomain *g_log_domains = NULL;
|
||||
static GLogLevelFlags g_log_always_fatal = G_LOG_FATAL_MASK;
|
||||
static GPrintFunc glib_print_func = NULL;
|
||||
static GPrintFunc glib_printerr_func = NULL;
|
||||
static GErrorFunc glib_error_func = NULL;
|
||||
@ -140,6 +141,24 @@ g_log_domain_get_handler (GLogDomain *domain,
|
||||
return g_log_default_handler;
|
||||
}
|
||||
|
||||
GLogLevelFlags
|
||||
g_log_set_always_fatal (GLogLevelFlags fatal_mask)
|
||||
{
|
||||
GLogLevelFlags old_mask;
|
||||
|
||||
/* restrict the global mask to levels that are known to glib */
|
||||
fatal_mask &= (1 << G_LOG_LEVEL_USER_SHIFT) - 1;
|
||||
/* force errors to be fatal */
|
||||
fatal_mask |= G_LOG_LEVEL_ERROR;
|
||||
/* remove bogus flag */
|
||||
fatal_mask &= ~G_LOG_FLAG_FATAL;
|
||||
|
||||
old_mask = g_log_always_fatal;
|
||||
g_log_always_fatal = fatal_mask;
|
||||
|
||||
return old_mask;
|
||||
}
|
||||
|
||||
GLogLevelFlags
|
||||
g_log_set_fatal_mask (const gchar *log_domain,
|
||||
GLogLevelFlags fatal_mask)
|
||||
@ -271,7 +290,8 @@ g_logv (const gchar *log_domain,
|
||||
if (g_log_depth++)
|
||||
test_level |= G_LOG_FLAG_RECURSION;
|
||||
|
||||
if (((domain ? domain->fatal_mask : G_LOG_FATAL_MASK) & test_level) != 0)
|
||||
if ((((domain ? domain->fatal_mask : G_LOG_FATAL_MASK) | g_log_always_fatal) &
|
||||
test_level) != 0)
|
||||
test_level |= G_LOG_FLAG_FATAL;
|
||||
log_func = g_log_domain_get_handler (domain, test_level, &data);
|
||||
log_func (log_domain, test_level, buffer, data);
|
||||
|
19
grel.c
19
grel.c
@ -250,7 +250,7 @@ g_relation_delete (GRelation *relation,
|
||||
|
||||
g_hash_table_destroy (key_table);
|
||||
|
||||
/* @@@ Remove empty hash tables. */
|
||||
/* @@@ FIXME: Remove empty hash tables. */
|
||||
|
||||
return count - rel->count;
|
||||
}
|
||||
@ -376,20 +376,23 @@ g_relation_print_one (gpointer tuple_key,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint i;
|
||||
GString *gstring;
|
||||
GRealRelation* rel = (GRealRelation*) user_data;
|
||||
gpointer* tuples = (gpointer*) tuple_value;
|
||||
|
||||
g_print ("[");
|
||||
gstring = g_string_new ("[");
|
||||
|
||||
for (i = 0; i < rel->fields; i += 1)
|
||||
{
|
||||
g_print ("%p", tuples[i]);
|
||||
g_string_sprintfa (gstring, "%p", tuples[i]);
|
||||
|
||||
if (i < (rel->fields - 1))
|
||||
g_print (",");
|
||||
g_string_append (gstring, ",");
|
||||
}
|
||||
|
||||
g_print ("]\n");
|
||||
g_string_append (gstring, "]");
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, gstring->str);
|
||||
g_string_free (gstring, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -400,7 +403,7 @@ g_relation_print_index (gpointer tuple_key,
|
||||
GRealRelation* rel = (GRealRelation*) user_data;
|
||||
GHashTable* table = (GHashTable*) tuple_value;
|
||||
|
||||
g_print ("*** key %p\n", tuple_key);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "*** key %p", tuple_key);
|
||||
|
||||
g_hash_table_foreach (table,
|
||||
g_relation_print_one,
|
||||
@ -413,7 +416,7 @@ g_relation_print (GRelation *relation)
|
||||
gint i;
|
||||
GRealRelation* rel = (GRealRelation*) relation;
|
||||
|
||||
g_print ("*** all tuples (%d)\n", rel->count);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "*** all tuples (%d)", rel->count);
|
||||
|
||||
g_hash_table_foreach (rel->all_tuples,
|
||||
g_relation_print_one,
|
||||
@ -424,7 +427,7 @@ g_relation_print (GRelation *relation)
|
||||
if (rel->hashed_tuple_tables[i] == NULL)
|
||||
continue;
|
||||
|
||||
g_print ("*** index %d\n", i);
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO, "*** index %d", i);
|
||||
|
||||
g_hash_table_foreach (rel->hashed_tuple_tables[i],
|
||||
g_relation_print_index,
|
||||
|
3
gtree.c
3
gtree.c
@ -712,7 +712,8 @@ g_tree_node_check (GTreeNode *node)
|
||||
|
||||
balance = right_height - left_height;
|
||||
if (balance != node->balance)
|
||||
g_print ("g_tree_node_check: failed: %d ( %d )\n",
|
||||
g_log (g_log_domain_glib, G_LOG_LEVEL_INFO,
|
||||
"g_tree_node_check: failed: %d ( %d )\n",
|
||||
balance, node->balance);
|
||||
|
||||
if (node->left)
|
||||
|
Loading…
x
Reference in New Issue
Block a user