Skip to content

Commit d807214

Browse files
committed
DPL: add signposts with log-level detail.
1 parent 7bbe964 commit d807214

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Framework/Foundation/include/Framework/Signpost.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,17 @@ void o2_debug_log_set_stacktrace(_o2_log_t* log, int stacktrace)
532532
} \
533533
})
534534

535+
// Similar to the above, however it will print a normal info message if the signpost is not enabled.
536+
#define O2_SIGNPOST_EVENT_EMIT_DETAIL(log, id, name, format, ...) __extension__({ \
537+
if (O2_BUILTIN_UNLIKELY(O2_SIGNPOST_ENABLED_MAC(log))) { \
538+
O2_SIGNPOST_EVENT_EMIT_MAC(log, id, name, format, ##__VA_ARGS__); \
539+
} else if (O2_BUILTIN_UNLIKELY(private_o2_log_##log->stacktrace)) { \
540+
_o2_signpost_event_emit(private_o2_log_##log, id, name, remove_engineering_type(format).data(), ##__VA_ARGS__); \
541+
} else { \
542+
O2_LOG_MACRO_RAW(detail, remove_engineering_type(format).data(), ##__VA_ARGS__); \
543+
} \
544+
})
545+
535546
// Similar to the above, however it will always print a normal error message regardless of the signpost being enabled or not.
536547
#define O2_SIGNPOST_EVENT_EMIT_ERROR(log, id, name, format, ...) __extension__({ \
537548
if (O2_BUILTIN_UNLIKELY(O2_SIGNPOST_ENABLED_MAC(log))) { \

0 commit comments

Comments
 (0)