logging: Add timestamp getter function part of internal API
Expose timestamp getter so it can be used, e.g. in the frontend. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
24372f4e84
commit
8b0d429bfd
2 changed files with 15 additions and 4 deletions
|
@ -105,6 +105,12 @@ bool z_log_msg2_pending(void);
|
|||
*/
|
||||
const char *z_log_get_tag(void);
|
||||
|
||||
/** @brief Get timestamp.
|
||||
*
|
||||
* @return Timestamp.
|
||||
*/
|
||||
log_timestamp_t z_log_timestamp(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -160,6 +160,11 @@ static log_timestamp_t dummy_timestamp(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
log_timestamp_t z_log_timestamp(void)
|
||||
{
|
||||
return timestamp_func();
|
||||
}
|
||||
|
||||
uint32_t z_log_get_s_mask(const char *str, uint32_t nargs)
|
||||
{
|
||||
char curr;
|
||||
|
@ -611,6 +616,10 @@ void log_core_init(void)
|
|||
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING)) {
|
||||
z_log_runtime_filters_init();
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_LOG_FRONTEND)) {
|
||||
log_frontend_init();
|
||||
}
|
||||
}
|
||||
|
||||
void log_init(void)
|
||||
|
@ -618,10 +627,6 @@ void log_init(void)
|
|||
__ASSERT_NO_MSG(log_backend_count_get() < LOG_FILTERS_NUM_OF_SLOTS);
|
||||
int i;
|
||||
|
||||
if (IS_ENABLED(CONFIG_LOG_FRONTEND)) {
|
||||
log_frontend_init();
|
||||
}
|
||||
|
||||
if (atomic_inc(&initialized) != 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue