mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Testing: Add a basic print-to-stdout log handler as a test debugging aid.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22112 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e6c0795652
commit
b5c62a1385
@ -450,6 +450,17 @@ test_checked_handler (const char *log_domain, GLogLevelFlags log_level,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
test_log_handler (const char *log_domain, GLogLevelFlags log_level,
|
||||||
|
const gchar *msg, gpointer user_data )
|
||||||
|
{
|
||||||
|
gchar *level = test_log_level (log_level);
|
||||||
|
g_printf ( "<%s> (%s) %s\n", level, log_domain, msg);
|
||||||
|
g_free (level);
|
||||||
|
g_assert (log_level ^ G_LOG_FLAG_FATAL);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
test_set_called( const gboolean val )
|
test_set_called( const gboolean val )
|
||||||
{
|
{
|
||||||
|
@ -112,6 +112,15 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
gboolean test_checked_handler (const char *log_domain, GLogLevelFlags log_level,
|
gboolean test_checked_handler (const char *log_domain, GLogLevelFlags log_level,
|
||||||
const gchar *msg, gpointer user_data);
|
const gchar *msg, gpointer user_data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Just print the log message. Since GLib has a habit of eating its
|
||||||
|
* log messages, it's sometimes useful to call
|
||||||
|
* g_test_log_set_fatal_handler() with this to make sure that
|
||||||
|
* g_return_if_fail() error messages make it to the surface.
|
||||||
|
*/
|
||||||
|
gboolean test_log_handler (const char *log_domain, GLogLevelFlags log_level,
|
||||||
|
const gchar *msg, gpointer user_data);
|
||||||
/**
|
/**
|
||||||
* Just returns FALSE or suppresses the message regardless of what the
|
* Just returns FALSE or suppresses the message regardless of what the
|
||||||
* error is. Use this only as a last resort.
|
* error is. Use this only as a last resort.
|
||||||
|
Loading…
Reference in New Issue
Block a user