Prints the log message prologue: timestamp, severity, and subsystem name.
248 {
251
252 char seconds[2];
255 char temp = seconds[0];
256 seconds[0] = '0';
257 seconds[1] = temp;
258 }
259
260 char minutes[2];
263 char temp = minutes[0];
264 minutes[0] = '0';
265 minutes[1] = temp;
266 }
267
268 char hours[2];
271 char temp = hours[0];
272 hours[0] = '0';
273 hours[1] = temp;
274 }
275
276 char time_format[] = "(__:__:__)";
277
278 str_set(time_format, seconds, 2, 7);
279 str_set(time_format, minutes, 2, 4);
280 str_set(time_format, hours, 2, 1);
281
283
284 char log_level_str[16];
285 uint8_t log_level_len = 0;
286 log_level_str[0] = '(';
289 log_level_str[log_level_len] = ')';
290 log_level_str[log_level_len + 1] = '\0';
291
294 (uint8_t*)log_level_str,
296 );
297
302 );
303
306 (uint8_t*)"-> ",
307 3
308 );
309
311}
static struct internal_state_s internal_state
Singleton instance of the SysTick driver internal state.
void str_set(char *target_str, char const *host_str, uint32_t host_str_len, uint32_t pos)
Overwrites a region of a target string with the contents of a source string.
uint32_t get_str_len(char const *str)
Returns the length of a string, excluding the null terminator.
void int_to_str(int num, char *str)
Converts an integer to its decimal string representation.
ERR_te log_get_level_name(LOG_LEVEL_te log_level, char *str)
Converts a LOG_LEVEL_te value to its lowercase string name.
void rtc_get_time(TIME_ts *time)
Reads the current time from the RTC.
void usart_send(USART_REGDEF_ts *usart_instance, uint8_t *tx_buffer, uint32_t len)
Blocking USART transmit. Sends len bytes from tx_buffer.
const char * modules_names[]
External array mapping MODULES_te values to their name strings.
Holds a time-of-day value (hours, minutes, seconds).