UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
debug.cpp File Reference
#include "config_unix.h"
#include "config_win32.h"
#include <array>
#include <atomic>
#include <cstdint>
#include <string>
#include <string_view>
#include <unordered_map>
#include "debug.h"
#include "host.h"
#include "utils/color_out.h"
#include "utils/string_view_utils.hpp"
#include "utils/misc.h"
Include dependency graph for debug.cpp:

Go to the source code of this file.

Functions

static void _dprintf (const char *format,...)
 
void bug_msg (int level, const char *format,...)
 prints the error with the advice to report the bug
 
void debug_dump (const void *lp, int len)
 
void log_msg (int level, const char *format,...)
 
void log_msg_once (int level, uint32_t id, const char *msg,...)
 
void log_perror (int level, const char *msg)
 
static void log_vprintf (int level, const char *format, va_list ap)
 
bool parse_log_cfg (const char *conf_str, int *log_lvl, bool *logger_skip_repeats, log_timestamp_mode *show_timestamps)
 

Variables

volatile int log_level = LOG_LEVEL_INFO
 

Function Documentation

◆ _dprintf()

static void _dprintf ( const char * format,
... )
static

Definition at line 67 of file debug.cpp.

68{
70 return;
71 }
72
73#ifdef _WIN32
74 char msg[65535];
75 va_list ap;
76
77 va_start(ap, format);
78 _vsnprintf(msg, 65535, format, ap);
79 va_end(ap);
80 OutputDebugString(msg);
81#else
82 va_list ap;
83
84 va_start(ap, format);
85 vfprintf(stderr, format, ap);
86 va_end(ap);
87#endif /* _WIN32 */
88}
volatile int log_level
Definition debug.cpp:65
#define LOG_LEVEL_DEBUG
Definition kernels.cu:48

References log_level, and LOG_LEVEL_DEBUG.

Referenced by debug_dump().

◆ bug_msg()

void bug_msg ( int level,
const char * format,
... )

prints the error with the advice to report the bug

Parameters
msgthe message to be printed, can be prefixed with particular MOD_NAME. Should end with either ' ' or '
' (what fits the caller better).

Definition at line 379 of file debug.cpp.

380{
381 char fmt_adj[STR_LEN];
382 snprintf_ch(fmt_adj,
383 "%sPlease report a bug"
384#ifdef PACKAGE_BUGREPORT
385 " to " PACKAGE_BUGREPORT
386#endif // defined PACKAGE_BUGREPORT
387 " if you reach here.\n",
388 format);
389
390 va_list ap;
391 va_start(ap, format);
392 log_vprintf(level, fmt_adj, ap);
393 va_end(ap);
394}
static void log_vprintf(int level, const char *format, va_list ap)
Definition debug.cpp:91
#define snprintf_ch(str,...)
shortcut for snprintf(var, sizeof var...), var must be a char array
Definition macros.h:101
@ STR_LEN
"standard" string length placeholder
Definition macros.h:134

References log_vprintf(), snprintf_ch, and STR_LEN.

Referenced by audio_cap_alsa_init(), get_mode(), jack_samplerate_changed_callback(), process_args(), ultragrid::aja::display::RouteOutputSignal(), set_display_mode_properties(), text_postprocess_reconfigure(), and vidcap_dshow_get_video_desc().

Here is the call graph for this function:

◆ debug_dump()

void debug_dump ( const void * lp,
int len )

debug_dump: @lp: pointer to memory region. @len: length of memory region in bytes.

Writes a dump of a memory region to stdout. The dump contains a hexadecimal and an ascii representation of the memory region.

Definition at line 179 of file debug.cpp.

180{
182 return;
183 }
184 const char *p;
185 int i, j, start;
186 char Buff[81];
187 char tmpBuf[10];
188
189 _dprintf("Dump of %d=%xh bytes\n", len, len);
190 start = 0L;
191 while (start < len) {
192 /* start line with pointer position key */
193 p = (const char *)lp + start;
194 snprintf(Buff, sizeof Buff, "%p: ", p);
195
196 /* display each character as hex value */
197 for (i = start, j = 0; j < 16; p++, i++, j++) {
198 if (i < len) {
199 snprintf(tmpBuf, sizeof tmpBuf, "%02X", ((int)(*p) & 0xFF));
200 strcat(Buff, tmpBuf);
201 } else
202 strcat(Buff, " ");
203 if (j % 2 == 1) /* space between groups of 2 */
204 strcat(Buff, " ");
205 if (j == 7) /* space between groups of 8 */
206 strcat(Buff, " ");
207 }
208
209 strcat(Buff, " ");
210
211 /* display each character as character value */
212 for (i = start, j = 0, p = (const char *)lp + start;
213 (i < len && j < 16); p++, i++, j++) {
214 if (((*p) >= ' ') && ((*p) <= '~')) /* test displayable */
215 snprintf(tmpBuf, sizeof tmpBuf, "%c", *p);
216 else
217 snprintf(tmpBuf, sizeof tmpBuf, "%c", '.');
218 strcat(Buff, tmpBuf);
219 if (j == 7) /* space between groups of 8 */
220 strcat(Buff, " ");
221 }
222 _dprintf("%s\n", Buff);
223 start = i; /* next line starting byte */
224 }
225}
int void size_t * len
static void _dprintf(const char *format,...)
Definition debug.cpp:67
static void start()
Definition sdp.c:202

References _dprintf(), len, log_level, LOG_LEVEL_DEBUG, and start().

Referenced by validate_rtcp().

Here is the call graph for this function:

◆ log_msg()

void log_msg ( int level,
const char * format,
... )

Definition at line 130 of file debug.cpp.

130 {
131 va_list ap;
132 va_start(ap, format);
133 log_vprintf(level, format, ap);
134 va_end(ap);
135}

References log_vprintf().

Referenced by Openxr_instance::Openxr_instance(), adec_compute_and_print_stats(), adjust_params(), append_audio_frame(), asend_compute_and_print_stats(), attach_input_ports(), audio_buffer_read(), audio_ca_get_device_name(), audio_ca_probe(), audio_cap_alsa_init(), audio_cap_alsa_read(), audio_cap_ca_init(), audio_cap_jack_init(), audio_cap_pipewire_init(), audio_cap_portaudio_init(), audio_cap_sdl_mixer_init(), audio_cap_testcard_read(), audio_capture_init(), audio_capture_init_null_device(), audio_codec_decompress(), audio_codec_init_real(), audio_decoder_init(), audio_decoder_reconfigure(), audio_filter_init(), audio_init(), audio_jack_probe(), audio_play_alsa_init(), audio_play_alsa_put_frame(), audio_play_alsa_query_format(), audio_play_alsa_reconfigure(), audio_play_alsa_write_frame(), audio_play_ca_init(), audio_play_jack_init(), audio_play_jack_put_frame(), audio_play_jack_query_format(), audio_play_jack_reconfigure(), audio_play_portaudio_init(), audio_play_portaudio_reconfigure(), audio_play_pw_init(), audio_play_pw_put_frame(), audio_play_pw_reconfigure(), audio_play_sdi_query_format(), audio_playback_done(), audio_playback_init(), audio_playback_init_null_device(), audio_portaudio_probe(), audio_reading_thread(), audio_receiver_process_message(), audio_sender_process_message(), audio_sender_thread(), audio_start(), audio_testcard_read_wav(), av_log_ug_callback(), blacklist_current_out_codec(), blackmagic_api_version_check(), bmd_check_stereo_profile(), border_init(), border_postprocess(), callback(), cf_text_filter(), change_replica_type(), check_duration(), check_first_sps_vps(), check_mixer(), check_reconf(), check_rtp_compatibility(), choose_codec_and_decoder(), cineform_compress_init(), cineform_compress_pop(), cineform_compress_push(), cineform_decompress(), cineform_decompress_init(), cleanup(), cleanup_common(), com_initialize(), common_postprocess_reconfigure(), common_preinit(), configure(), configure_audio(), configure_with(), configure_with(), configure_with(), configure_with(), control_init(), control_report_stats_event(), control_start(), control_thread(), create_decklink_iterator(), create_dir(), create_dumb_fb(), create_implicit_dir(), create_output_port(), create_video_rxtx_ihdtv(), crop_init(), decklink_help(), decode_audio_frame(), decode_frame(), decode_nal_unit(), decode_video_frame(), decompress_j2k_worker(), deinterlace_blend_init(), deinterlace_init(), deinterlace_postprocess(), delta_set_nb_channels(), detect_format(), discover_and_xchg_candidates(), display_aggregate_put_audio_frame(), rtp_video_rxtx::display_buf_increase_warning(), display_caca_init(), display_conference_init(), display_conference_putf(), display_conference_worker(), display_ctl_property(), display_decklink_init(), display_decklink_put_audio_frame(), display_decklink_reconfigure(), display_deltacast_getf(), display_deltacast_init(), display_deltacast_putf(), display_deltacast_reconfigure(), display_deltacast_reconfigure_audio(), display_drm_done(), display_drm_reconfigure(), display_dummy_putf(), display_dump_init(), display_dvs_run(), display_file_init(), display_file_put_audio_frame(), display_file_putf(), display_frame(), display_frame_helper(), display_gl_check_gl_version(), display_gl_init(), display_gl_init_opengl(), display_gl_parse_fmt(), display_ndi_init(), display_pw_getf(), display_pw_init(), display_reconfigure(), display_reconfigure_audio(), display_run_new_thread(), display_sage_run(), display_sdl2_init(), display_sdl2_process_key(), display_sdl2_putf(), display_sdl2_reconfigure(), display_sdl2_reconfigure_real(), display_sdl2_run(), display_sdl_init(), display_sdl_run(), display_unix_sock_init(), display_unix_sock_putf(), display_unix_sock_run(), display_v4l2_init(), display_v4l2_probe(), display_xrgl_run(), draw_line_init(), draw_splash(), drm_fb_from_frame(), dummy_parse_opts(), echo_cancel(), echo_cancellation_init(), echo_play(), ErrorDescription(), exchange_coord_desc(), exit_uv(), export_video(), fec_thread(), image_pattern_ebu_smpte_bars< f, columns >::fill(), image_pattern_smpte_bars::fill(), filter(), filter(), filter(), filter(), filter(), filter(), filter(), Filter_chain::filter(), gen_sdp(), generate_signal(), get_16_bit_pnm_data(), get_ach_count(), get_audio(), get_av_to_uv_conversion(), get_field_order(), bmd_option::get_flag(), get_format_callback(), get_fps(), get_input_modes(), bmd_option::get_int(), get_local_addresses(), get_mode(), get_rtsp_server_port(), get_sched_latency_ns(), get_supported_format(), get_tile_count(), get_ug_codec_to_av(), get_ug_to_sdl_format(), get_usable_decoders(), get_wav_error(), vidcap_state_aja::GetVideoFormatFromInputSource(), gl_process_frames(), gl_reconfigure_screen(), glfw_key_callback(), glfw_resize_window(), glsl_compile_link(), gpujpeg_decompress_init(), gpujpeg_probe_internal_codec(), gpujpeg_to_dxt_decompress_init(), GraphPause(), GraphRun(), handle_lavd_error(), have_audio_for_video(), hd_rum_decompress_init(), device_state::init(), init(), init(), init(), init(), init(), init(), init(), init_audio(), init_common(), init_decoder(), init_drm_state(), init_encoder(), init_stitcher(), initialize(), initialize(), initialize(), initialize_import(), initialize_video_capture(), initialize_video_display(), InputProc(), interlaced_3d_init(), is_emulated(), j2k_compress_init(), j2k_compress_pop(), j2k_decompress_cleanup_common(), j2k_probe_internal_codec(), jack_process_callback(), jack_samplerate_changed_callback(), jack_start(), jpeg_callback(), jpeg_get_rtp_hdr_data(), jpeg_read_info(), juice_log_handler(), keycontrol_register_key(), keycontrol_send_key(), lavd_flush(), libavcodec_decompress(), libavcodec_decompress(), libavcodec_init(), load_logo_data_from_file(), load_screen_cap_rec_library(), log_perror(), main(), main(), map_frame_buffers(), module_done(), nat_traverse_keepalive(), ndi_disp_format_video_metadata(), NDIlib_load(), new_message(), on_add_buffer(), on_candidate(), on_core_error(), on_param_changed(), on_process(), on_remove_buffer(), on_state_changed(), on_stream_param_changed(), oneshot_init(), open_dri(), open_libjack(), openssl_decrypt(), openssl_decrypt_init(), openssl_encrypt(), openssl_encrypt_init(), operator>>(), parse(), parse_audio_capture(), parse_audio_format(), parse_bitrate(), parse_cfg(), parse_channel_map_cfg(), parse_codecs(), parse_config_string(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_fmt(), parse_format(), parse_fps(), parse_holepunch_conf(), parse_option(), parse_options(), parse_options_internal(), parse_opts(), parse_video_desc_info(), parse_video_hdr(), pbuf_destroy(), pbuf_insert(), pbuf_process_stats(), display_bluefish444_state::playback_loop(), playback_register_keyboard_ctl(), playback_set_device(), portaudio_get_device_name(), portaudio_print_help(), portaudio_print_version(), portaudio_select_device_by_name(), portaudio_start_stream(), prepare(), print_alsa_device_info(), print_available_delta_boards(), print_capabilities(), print_current_pos(), print_decoder_error(), print_drm_driver_info(), print_dropped(), print_fps(), print_libav_audio_error(), print_libav_error(), print_output_modes(), print_packet_info(), print_rtsp_header(), print_winreg_values(), PrintError(), probe_drm_formats(), probe_internal(), probe_internal_cineform(), process_args(), process_message(), process_messages(), process_messages(), process_msg(), process_nal(), process_rr(), process_video_pkt(), punch_udp(), QSORT_S_COMP_DEFINE(), read_adobe_app14(), read_dht(), read_dqt(), read_dri(), read_ds64(), read_fmt_chunk(), read_forced_pixfmt(), read_sof0(), read_sos(), read_wav_header(), ultragrid_rtp_video_rxtx::receiver_loop(), ultragrid_rtp_video_rxtx::receiver_process_messages(), recompress_port_write(), reconfigure(), reconfigure_convert_if_needed(), reconfigure_helper(), reconfigure_send_ch_count(), reconfigure_thread(), recreate_textures(), register_param(), register_screen_cap_rec_library(), reinitialize_decoder(), reinitialize_encoder(), report_stats(), reset_acquisition(), resolve_addrinfo(), restartAcquisition(), rtcp_udp_send(), rtp_init_if(), rtp_init_with_udp_socket(), rtp_process_data(), rtp_send_data_hdr(), keyboard_control::impl::run(), run_child_process(), run_punch(), save_video_frame_as_pnm(), save_video_frame_as_y4m(), screenshot(), sdp_set_options(), select_il_func(), select_pixfmt_callback(), send_message_common(), serialize_video_avframe(), set_audio_delay(), vidcap_decklink_state::set_codec(), set_codec_context_params(), set_convertible_formats(), set_framebuffer(), set_key_from_str(), set_output_buffering(), set_pixfmt_conv_policy(), set_size(), set_size(), set_sock_opts_and_bind(), set_v4l2_buffers(), settings_init(), settings_init(), setup_crtc(), setup_nat_pmp(), setup_pcp(), setup_video(), show_help(), show_help(), socket_error(), keyboard_control::impl::start(), start(), start_acquisition(), start_nat_traverse(), strtol_checked(), testcard_load_from_file(), testcard_load_from_file_pam(), testcard_load_from_file_y4m(), text_init(), text_postprocess(), text_postprocess_reconfigure(), Participant_manager::tick(), to_lavc_vid_conv_init(), try_open_v4l2_device(), tv_diff_usec(), tx_init(), tx_send_jpeg(), udp_init_if(), udp_init_with_local(), udp_join_mcast_grp4(), udp_join_mcast_grp6(), udp_port_pair_is_free(), udp_set_buf(), ug_perror(), unit_evaluate_dbl(), usage(), v4l2_cap_verify_params(), vaapi_init(), channel_map::validate(), validate_settings(), vdp_interop_supported(), vdpau_init(), vidcap_aggregate_grab(), vidcap_bitflow_done(), vidcap_bitflow_grab(), vidcap_bitflow_init(), vidcap_decklink_grab(), vidcap_decklink_init(), vidcap_decklink_probe(), vidcap_deltacast_dvi_grab(), vidcap_deltacast_dvi_init(), vidcap_deltacast_grab(), vidcap_deltacast_init(), vidcap_dshow_done(), vidcap_dshow_init(), vidcap_dshow_probe_internal(), vidcap_dvs_grab(), vidcap_dvs_init(), vidcap_file_init(), vidcap_file_open_dec_ctx(), vidcap_file_parse_fmt(), vidcap_file_process_messages(), vidcap_file_worker(), vidcap_file_write_audio(), vidcap_gpustitch_init(), vidcap_import_grab(), vidcap_rtsp_init(), vidcap_screen_linux_init(), vidcap_screen_osx_grab(), vidcap_screen_osx_init(), vidcap_screen_win_init(), vidcap_switcher_grab(), vidcap_switcher_register_keyboard_ctl(), vidcap_swmix_grab(), vidcap_syphon_init_common(), vidcap_testcard2_init(), vidcap_testcard2_thread(), vidcap_testcard_init(), vidcap_ug_input_grab(), vidcap_v4l2_grab(), vidcap_v4l2_init(), vidcap_ximea_fill_symbols(), vidcap_ximea_grab(), vidcap_ximea_init(), vidcap_ximea_parse_params(), vidcap_ximea_probe(), vidcap_ximea_show_help(), video_decoder_init(), video_decoder_register_display(), VideoDelegate::VideoInputFrameArrived(), videotoolbox_init(), vo_postprocess_reconfigure(), wait_for_channel(), wait_for_channel_locked(), watch_pixfmt_degrade(), worker(), worker(), worker(), worker(), worker_thread(), write_video_frame(), and writer().

Here is the call graph for this function:

◆ log_msg_once()

void log_msg_once ( int level,
uint32_t id,
const char * msg,
... )

Definition at line 137 of file debug.cpp.

137 {
138 if (log_level < level) {
139 return;
140 }
141 static volatile uint32_t oneshot_messages[10];
142 static atomic<size_t> oneshot_messages_cnt;
143 for (size_t i = 0; i < oneshot_messages_cnt; ++i) {
144 if (oneshot_messages[i] == id) {
145 return;
146 }
147 }
148
149 va_list aq;
150 va_start(aq, msg);
151 log_vprintf(level, msg, aq);
152 va_end(aq);
153
154 size_t last_cnt = oneshot_messages_cnt.fetch_add(1);
155 if (last_cnt < sizeof oneshot_messages / sizeof oneshot_messages[0]) {
156 oneshot_messages[last_cnt] = id;
157 } else {
158 log_msg(LOG_LEVEL_WARNING, "oneshot_messages full!\n");
159 }
160}
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_WARNING
less severe errors
Definition debug.h:60

Referenced by audio_tx_send_chan(), create_jpeg_frame(), decode_audio_frame(), decode_video_frame(), display_frame(), get_audio(), parse_quant_tables(), parse_video_hdr(), perform_df(), print_dropped(), and validate_std_audio().

◆ log_perror()

void log_perror ( int level,
const char * msg )

This function is analogous to perror(). The message is printed using the logger.

Definition at line 165 of file debug.cpp.

166{
167 log_msg(level, "%s: %s\n", msg, ug_strerror(errno));
168}
const char * ug_strerror(int errnum)
Definition misc.cpp:203

References log_msg(), and ug_strerror().

Referenced by deinit_device(), display_v4l2_getf(), display_v4l2_putf(), display_v4l2_reconfigure(), enqueue_all_finished_frames(), print_fps(), set_v4l2_buffers(), show_help(), try_open_v4l2_device(), vidcap_v4l2_common_cleanup(), vidcap_v4l2_grab(), vidcap_v4l2_init(), and vidcap_v4l2_probe().

Here is the call graph for this function:

◆ log_vprintf()

static void log_vprintf ( int level,
const char * format,
va_list ap )
static

Definition at line 91 of file debug.cpp.

92{
93 va_list aq;
94
95 if (log_level < level) {
96 return;
97 }
98
99 // get number of required bytes
100 va_copy(aq, ap);
101 int size = vsnprintf(NULL, 0, format, aq);
102 va_end(aq);
103
104 // format the string
105 auto buf = get_log_output().get_buffer();
106 const auto& style = get_log_output().get_level_style(level);
107
108 buf.append(style);
109 buf.append(size + 1, '\0');
110
111 va_copy(aq, ap);
112 vsnprintf(buf.data() + style.length(), size + 1, format, ap);
113 va_end(aq);
114 auto & str = buf.get();
115 str.resize(str.size() - 1); // drop '\0' written by vsnprintf
116
117 if (!get_log_output().is_interactive()) {
119 } else if (style.size() > 0) {
120 if (str.at(str.size() - 1) == '\n') { // put TERM_RESET before '\n'
121 str.erase(str.size() - 1);
122 buf.append(TERM_RESET "\n");
123 } else {
124 buf.append(TERM_RESET);
125 }
126 }
127 buf.submit();
128}
const std::string & get_level_style(int lvl)
Definition debug.h:194
Buffer get_buffer()
Definition debug.h:153
void prune_ansi_sequences_inplace(std::string &str)
#define TERM_RESET
Definition color_out.h:47
Log_output & get_log_output()
Definition debug.h:266
int vsnprintf(char *s, size_t buf_size, const char *format, va_list ap)
Definition vsnprintf.c:46

References Log_output::get_buffer(), Log_output::get_level_style(), get_log_output(), log_level, prune_ansi_sequences_inplace(), TERM_RESET, and vsnprintf().

Referenced by bug_msg(), and log_msg().

Here is the call graph for this function:

◆ parse_log_cfg()

bool parse_log_cfg ( const char * conf_str,
int * log_lvl,
bool * logger_skip_repeats,
log_timestamp_mode * show_timestamps )

Definition at line 227 of file debug.cpp.

231{
232 assert(conf_str != nullptr);
233 assert(log_lvl != nullptr);
234 assert(logger_skip_repeats != nullptr);
235 assert(show_timestamps != nullptr);
236
237 using std::clog;
238
239 static const struct { const char *name; int level; } mapping[] = {
240 { "quiet", LOG_LEVEL_QUIET },
241 { "fatal", LOG_LEVEL_FATAL },
242 { "error", LOG_LEVEL_ERROR },
243 { "warning", LOG_LEVEL_WARNING},
244 { "notice", LOG_LEVEL_NOTICE},
245 { "info", LOG_LEVEL_INFO },
246 { "verbose", LOG_LEVEL_VERBOSE},
247 { "debug", LOG_LEVEL_DEBUG },
248 { "debug2", LOG_LEVEL_DEBUG2 },
249 };
250
251 std::string_view cfg = conf_str;
252
253 if (cfg == "help") {
254 col() << "log level: [0-" << LOG_LEVEL_MAX;
255 for (auto m : mapping) {
256 col() << "|" << m.name;
257 }
258 col() << "][+repeat][+/-timestamps]\n";
259 col() << TBOLD("\trepeat") << " - print repeating log messages\n";
260 col() << TBOLD("\ttimestamps") << " - enable/disable timestamps\n";
261 col() << "environment variable " << SBOLD("ULTRAGRID_VERBOSE") << " - use verbose output (same as `-V` on command-line)\n";
262 return false;
263 }
264
265 if (sv_contains(cfg, "+repeat")) {
266 *logger_skip_repeats = false;
267 }
268
269 if(auto ts_pos = cfg.find("timestamps"); ts_pos != cfg.npos && ts_pos > 0){
270 if(cfg[ts_pos - 1] == '+')
271 *show_timestamps = LOG_TIMESTAMP_ENABLED;
272 else
273 *show_timestamps = LOG_TIMESTAMP_DISABLED;
274 }
275
276 if (cfg.empty() || cfg[0] == '+' || cfg[0] == '-') { // only flags, no log level
277 return true;
278 }
279
280 if (isdigit(cfg[0])) {
281 long val = -1;
282 parse_num(cfg, val);
284 clog << "Log: wrong value: " << cfg << " (allowed range [0.." << LOG_LEVEL_MAX << "])\n";
285 return false;
286 }
287 *log_lvl = val;
288 return true;
289 }
290
291 auto log_lvl_sv = cfg;
292 auto sign_pos = log_lvl_sv.find_first_of("+-");
293 if(sign_pos != log_lvl_sv.npos)
294 log_lvl_sv.remove_suffix(log_lvl_sv.size() - sign_pos);
295
296 for (auto m : mapping) {
297 if (log_lvl_sv == m.name) {
298 *log_lvl = m.level;
299 return true;
300 }
301 }
302
303 LOG(LOG_LEVEL_ERROR) << "Wrong log level specification: " << cfg << "\n";
304 return false;
305}
int void * val
static const struct codec_param mapping[AC_COUNT]
Definition libavcodec.c:87
#define SBOLD(x)
Definition color_out.h:80
#define TBOLD(x)
Definition color_out.h:70
#define LOG_LEVEL_NOTICE
information that may be interesting
Definition debug.h:61
#define LOG_LEVEL_INFO
normal reporting
Definition debug.h:62
#define LOG_LEVEL_DEBUG2
Definition debug.h:67
#define LOG_LEVEL_QUIET
suppress all logging
Definition debug.h:57
#define LOG_LEVEL_ERROR
general errors
Definition debug.h:59
#define LOG_LEVEL_VERBOSE
Definition debug.h:63
#define LOG_LEVEL_MAX
Definition debug.h:69
#define LOG(level)
Definition debug.h:313
#define LOG_LEVEL_FATAL
errors that prevent UG run
Definition debug.h:58
@ LOG_TIMESTAMP_ENABLED
Definition debug.h:74
@ LOG_TIMESTAMP_DISABLED
Definition debug.h:73
const char * name
Definition settings.cpp:193
bool sv_contains(std::string_view haystack, std::string_view needle)
bool parse_num(std::string_view sv, T &res, int base=10)

References LOG, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG2, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_MAX, LOG_LEVEL_NOTICE, LOG_LEVEL_QUIET, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARNING, LOG_TIMESTAMP_DISABLED, LOG_TIMESTAMP_ENABLED, mapping, name, parse_num(), SBOLD, sv_contains(), TBOLD, and val.

Referenced by parse_opts_set_logging().

Here is the call graph for this function:

Variable Documentation

◆ log_level