Only print EXIT info when ndef NDEBUG
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 16 Sep 2013 17:02:17 +0000 (18:02 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 20 Sep 2013 18:20:00 +0000 (19:20 +0100)
src/lib/log.c

index bfde9ab..25cc121 100644 (file)
@@ -146,7 +146,7 @@ void fr_perror(char const *fmt, ...)
 bool fr_assert_cond(char const *file, int line, char const *expr, bool cond)
 {
        if (!cond) {
-               fr_perror("SOFT ASSERT FAILED %s[%u]: %s\n", file, line, expr);
+               fr_perror("SOFT ASSERT FAILED %s[%u]: %s", file, line, expr);
                return false;
        }
 
@@ -155,7 +155,9 @@ bool fr_assert_cond(char const *file, int line, char const *expr, bool cond)
 
 void NEVER_RETURNS _fr_exit(char const *file, int line, int status)
 {
-       fr_perror("EXIT CALLED %s[%u]: %i\n", file, line, status);
+#ifndef NDEBUG
+       fr_perror("EXIT CALLED %s[%u]: %i", file, line, status);
+#endif
        fflush(stderr);
 
        fr_debug_break();       /* If running under GDB we'll break here */
@@ -165,7 +167,9 @@ void NEVER_RETURNS _fr_exit(char const *file, int line, int status)
 
 void NEVER_RETURNS _fr_exit_now(char const *file, int line, int status)
 {
-       fr_perror("_EXIT CALLED %s[%u]: %i\n", file, line, status);
+#ifndef NDEBUG
+       fr_perror("_EXIT CALLED %s[%u]: %i", file, line, status);
+#endif
        fflush(stderr);
 
        fr_debug_break();       /* If running under GDB we'll break here */