From: Behdad Esfahbod Date: Fri, 11 May 2012 00:40:42 +0000 (+0200) Subject: Only printout class name in tracing, if one is available X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85f73fa8da1fbb864aef0f3a592b1d65e24d593d;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Only printout class name in tracing, if one is available Makes debug output much more pleasant. --- diff --git a/src/hb-private.hh b/src/hb-private.hh index dd2c465..1f7ba11 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -531,8 +531,12 @@ _hb_debug_msg_va (const char *what, else fprintf (stderr, " ├╴"); - if (func) - fprintf (stderr, "%s: ", func); + if (func) { + /* If there's a class name, just write that. */ + const char *dotdot = strstr (func, "::"); + unsigned int func_len = dotdot ? dotdot - func : strlen (func); + fprintf (stderr, "%*s: ", func_len, func); + } if (message) vfprintf (stderr, message, ap);