From b88abdcae4f25130d9e9fc75c8ab400dca95e451 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Fri, 12 Jun 2026 14:27:42 +0300 Subject: [PATCH] refactoring --- src/libs/logging.h | 21 ++++----------------- src/ustreamer/stream.c | 2 +- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/libs/logging.h b/src/libs/logging.h index 18601b1..d4d4bbd 100644 --- a/src/libs/logging.h +++ b/src/libs/logging.h @@ -72,23 +72,6 @@ extern pthread_mutex_t us_g_log_mutex; #define US_COLOR_RESET "\x1b[0m" -#define US_SEP_INFO(x_ch) { \ - US_LOGGING_LOCK; \ - for (int m_i = 0; m_i < 80; ++m_i) { \ - fputc((x_ch), stderr); \ - } \ - fputc('\n', stderr); \ - fflush(stderr); \ - US_LOGGING_UNLOCK; \ - } - -#define US_SEP_DEBUG(x_ch) { \ - if (us_g_log_level >= US_LOG_LEVEL_DEBUG) { \ - US_SEP_INFO(x_ch); \ - } \ - } - - #define US_LOG_PRINTF_NOLOCK(x_label_color, x_label, x_msg_color, x_msg, ...) { \ char m_tname_buf[US_THREAD_NAME_SIZE] = {0}; \ us_thread_get_name(m_tname_buf); \ @@ -110,6 +93,10 @@ extern pthread_mutex_t us_g_log_mutex; US_LOGGING_UNLOCK; \ } +#define US_LOG_SEP_INFO { \ + US_LOG_PRINTF(US_COLOR_GREEN, "INFO ", US_COLOR_GREEN, "============================================="); \ + } + #define US_LOG_ERROR(x_msg, ...) { \ US_LOG_PRINTF(US_COLOR_RED, "ERROR", US_COLOR_RED, x_msg, ##__VA_ARGS__); \ } diff --git a/src/ustreamer/stream.c b/src/ustreamer/stream.c index 9ae94e4..19f6f83 100644 --- a/src/ustreamer/stream.c +++ b/src/ustreamer/stream.c @@ -272,7 +272,7 @@ void us_stream_loop(us_stream_s *stream) { us_capture_close(cap); if (!atomic_load(&run->stop)) { - US_SEP_INFO('='); + US_LOG_SEP_INFO; } }