@@ -427,6 +427,38 @@ void __wrap_log_printf(const char *format, ...)
427
427
va_end (list );
428
428
}
429
429
#endif
430
+
431
+ void esp_diag_log_writev (esp_log_level_t level ,
432
+ const char * tag ,
433
+ const char * format ,
434
+ va_list args )
435
+ {
436
+ #ifndef CONFIG_DIAG_LOG_DROP_WIFI_LOGS
437
+ /* Only collect logs with "wifi" tag */
438
+ if (strcmp (tag , "wifi" ) == 0 ) {
439
+ uint32_t pc = 0 ;
440
+ pc = esp_cpu_process_stack_pc ((uint32_t )__builtin_return_address (0 ));
441
+ esp_diag_log (level , pc , tag , format , args );
442
+ }
443
+ #endif /* !CONFIG_DIAG_LOG_DROP_WIFI_LOGS */
444
+ }
445
+
446
+ void esp_diag_log_write (esp_log_level_t level ,
447
+ const char * tag ,
448
+ const char * format ,
449
+ va_list list )
450
+ {
451
+ #ifndef BOOTLOADER_BUILD
452
+ /* Logs with "wifi" tag, will be collected in esp_log_writev() */
453
+ if (strcmp (tag , "wifi" ) != 0 ) {
454
+ uint32_t pc = 0 ;
455
+ pc = esp_cpu_process_stack_pc ((uint32_t )__builtin_return_address (0 ));
456
+ esp_diag_log (level , pc , tag , format , list );
457
+ }
458
+ #endif
459
+ }
460
+
461
+ #if !CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP
430
462
/* Wrapping esp_log_write() and esp_log_writev() reduces the
431
463
* changes required in esp_log module to support diagnostics
432
464
*/
@@ -440,15 +472,7 @@ void __wrap_esp_log_writev(esp_log_level_t level,
440
472
const char * format ,
441
473
va_list args )
442
474
{
443
- #ifndef CONFIG_DIAG_LOG_DROP_WIFI_LOGS
444
- /* Only collect logs with "wifi" tag */
445
- if (strcmp (tag , "wifi" ) == 0 ) {
446
- uint32_t pc = 0 ;
447
- pc = esp_cpu_process_stack_pc ((uint32_t )__builtin_return_address (0 ));
448
- esp_diag_log (level , pc , tag , format , args );
449
- }
450
- #endif /* !CONFIG_DIAG_LOG_DROP_WIFI_LOGS */
451
-
475
+ esp_diag_log_write (level , tag , format , args );
452
476
__real_esp_log_writev (level , tag , format , args );
453
477
}
454
478
@@ -458,14 +482,8 @@ void __wrap_esp_log_write(esp_log_level_t level,
458
482
{
459
483
va_list list ;
460
484
va_start (list , format );
461
- #ifndef BOOTLOADER_BUILD
462
- /* Logs with "wifi" tag, will be collected in esp_log_writev() */
463
- if (strcmp (tag , "wifi" ) != 0 ) {
464
- uint32_t pc = 0 ;
465
- pc = esp_cpu_process_stack_pc ((uint32_t )__builtin_return_address (0 ));
466
- esp_diag_log (level , pc , tag , format , list );
467
- }
468
- #endif
485
+ esp_diag_log_writev (level , tag , format , list );
469
486
esp_log_writev (level , tag , format , list );
470
487
va_end (list );
471
488
}
489
+ #endif // CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP
0 commit comments