示例#1
0
文件: stack.c 项目: Katyunechka/gjs
void
gjstest_test_func_gjs_stack_dump(void)
{
  GjsContext *context;

  /* TODO this test could be better - maybe expose dumpstack as a JS API
   * so that we have a JS stack to dump?  At least here we're getting some
   * coverage.
   */
  context = gjs_context_new();
  gjs_dumpstack();
  g_object_unref(context);
  gjs_dumpstack();
}
示例#2
0
文件: main.c 项目: prahal/gnome-shell
static void
default_log_handler (const char     *log_domain,
                     GLogLevelFlags  log_level,
                     const char     *message,
                     gpointer        data)
{
  TpDebugSender *sender = data;
  GTimeVal now;

  g_get_current_time (&now);

  /* Send telepathy debug through DBus */
  if (log_domain != NULL && g_str_has_prefix (log_domain, "tp-glib"))
    tp_debug_sender_add_message (sender, &now, log_domain, log_level, message);

  /* Filter out telepathy-glib logs, we don't want to flood Shell's output
   * with those. */
  if (!log_domain || !g_str_has_prefix (log_domain, "tp-glib"))
    g_log_default_handler (log_domain, log_level, message, data);

  /* Filter out Gjs logs, those already have the stack */
  if (log_domain && strcmp (log_domain, "Gjs") == 0)
    return;

  if ((_shell_debug & SHELL_DEBUG_BACKTRACE_WARNINGS) &&
      ((log_level & G_LOG_LEVEL_CRITICAL) ||
       (log_level & G_LOG_LEVEL_WARNING)))
    gjs_dumpstack ();
}