File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -357,19 +357,31 @@ void printf_with_fileloc(
357
357
* by prepending stack trace */
358
358
__print_frame_unwind (NEW_BUFFER (__debug_frame_buf , 1024 ), 2 );
359
359
sprint_time (NEW_BUFFER (__debug_time_buf , 1024 ), read_clk (), SPRINT_TIME_HHMMSSCLK );
360
+ STREAM * fmt_buf = NEW_BUFFER (__verbose_print_buf , 1024 );
361
+
362
+ /* header is like "(TIMESTAMP) CPUn:log_level:[stack:stack:stack:stack]" */
360
363
sprintf (
361
- NEW_BUFFER ( __verbose_print_buf , 1024 ) ,
362
- "(%s) CPU%d:%s:[%s %s:%d (%s)] %s " ,
364
+ fmt_buf ,
365
+ "(%s) CPU%d:%s:[%s %s:%d (%s)]" ,
363
366
__debug_time_buf ,
364
367
cpu ,
365
368
level ,
366
369
__debug_frame_buf ,
367
370
filename ,
368
371
line ,
369
- func ,
370
- fmt
372
+ func
371
373
);
372
374
375
+ if (mode & PRINT_MODE_ERROR ) {
376
+ /* if this is an error print make sure the format appears on its own line. */
377
+ sprintf (fmt_buf , ":\n# " , fmt );
378
+ } else {
379
+ sprintf (fmt_buf , " " , fmt );
380
+ }
381
+
382
+ /* now write the actual printf() format string */
383
+ sprintf (fmt_buf , "%s" , fmt );
384
+
373
385
va_list ap ;
374
386
va_start (ap , fmt );
375
387
vprintf (mode , __verbose_print_buf , ap );
You can’t perform that action at this time.
0 commit comments