Committed.

Only print out gobs of information to log when -d3 is enabled.

The log is part of the user interface and by default it prints out too much
information which drowns normal messages.

If some of the messages are a bit terse without the -d3 context, then
the error messages should be fleshed out a bit.

$ openocd -f xyz.cfg
Open On-Chip Debugger 1.0 (2008-07-22-08:35) svn:exported
$URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $
Runtime error, file "?", line 1:
    Can't find xyz.cfg
In procedure 'script' called at file "?", line 1
In procedure 'find' called at file "?", line 1

$ openocd -d -f xyz.cfg
Open On-Chip Debugger 1.0 (2008-07-22-08:35) svn:exported
$URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $
User:    4 3 options.c:50 configuration_output_handler(): Runtime
error, file "?", line 1:
User:    5 4 options.c:50 configuration_output_handler():     Can't find xyz.cfg
User:    6 5 options.c:50 configuration_output_handler(): In procedure
'script'called at file "?", line 1
User:    7 6 options.c:50 configuration_output_handler(): In procedure
'find' called at file "?", line 1

Index: C:/workspace/trunk/src/helper/log.c
===================================================================
--- C:/workspace/trunk/src/helper/log.c (revision 853)
+++ C:/workspace/trunk/src/helper/log.c (working copy)
@@ -103,8 +103,9 @@
                }
                else
                {
-                       /* do not print count and time */
-                       fprintf(log_output, "%s %s:%d %s(): %s", 
log_strings[level+1],
file, line, function, string);
+                       /* print human readable output */
+                       fprintf(log_output, "%s%s",
+                                       (level > 
LOG_LVL_USER)?log_strings[level+1]:"", string);
                }
        } else
        {
Index: C:/workspace/trunk/src/helper/options.c
===================================================================
--- C:/workspace/trunk/src/helper/options.c     (revision 853)
+++ C:/workspace/trunk/src/helper/options.c     (working copy)
@@ -47,7 +47,7 @@

 int configuration_output_handler(struct command_context_s *context,
const char* line)
 {
-       LOG_INFO_N(line);
+       LOG_USER_N(line);

        return ERROR_OK;
 }

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to