From f06204262bf4c7cc81d15ba32ebccba06ef6f811 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 May 2021 14:48:53 +0200 Subject: [PATCH] Use environment variable ULTRAGRID_VERBOSE --- data/hd-rum-transcode.1 | 13 +++++++++++-- data/make_man.sh | 5 +++++ data/uv.1 | 13 +++++++++++-- src/debug.cpp | 4 ++++ 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/data/hd-rum-transcode.1 b/data/hd-rum-transcode.1 index 83dd87dc8..868913bba 100644 --- a/data/hd-rum-transcode.1 +++ b/data/hd-rum-transcode.1 @@ -2,12 +2,12 @@ .\" Title: hd-rum-transcode .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 03/29/2021 +.\" Date: 05/26/2021 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "HD\-RUM\-TRANSCODE" "1" "03/29/2021" "\ \&" "\ \&" +.TH "HD\-RUM\-TRANSCODE" "1" "05/26/2021" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -71,6 +71,15 @@ Transcoder can be used as a reflector also for audio (and must be used if audio .SS "Reflector running on UltraGrid sender machine" .sp \fBuv\fR \-t testcard \-s testcard \fI\-P 6004:5004:6006:5006\fR localhost \fBhd\-rum\-transcode\fR 8M 5004 receiver1 receiver2 \-c JPEG receiver3 # video \fBhd\-rum\-transcode\fR 8M 5006 receiver1 receiver2 receiver3 # audio +.SH "ENVIRONMENT VARIABLES" +.PP +\fBULTRAGRID_VERBOSE\fR +.RS 4 +If is +ULTRAGRID_VERBOSE +environment variable is set, default UltraGrid log level is +verbose\&. Command\-line option always overrides this value\&. +.RE .SH "REPORTING BUGS" .sp Report bugs to \fBultragrid\-dev@cesnet\&.cz\fR or use project \fBGitHub\fR to describe issues\&. diff --git a/data/make_man.sh b/data/make_man.sh index 399f9893d..c73be08c7 100755 --- a/data/make_man.sh +++ b/data/make_man.sh @@ -6,6 +6,11 @@ bugreport_and_resources() { cat <<-'EOF' + == ENVIRONMENT VARIABLES == + *`ULTRAGRID_VERBOSE`*:: + If is `ULTRAGRID_VERBOSE` environment variable is set, default UltraGrid + log level is `verbose`. Command-line option always overrides this value. + == REPORTING BUGS == Report bugs to *ultragrid-dev@cesnet.cz* or use project *GitHub* to describe issues. diff --git a/data/uv.1 b/data/uv.1 index 1dab0c082..651743de0 100644 --- a/data/uv.1 +++ b/data/uv.1 @@ -2,12 +2,12 @@ .\" Title: uv .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 03/29/2021 +.\" Date: 05/26/2021 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "UV" "1" "03/29/2021" "\ \&" "\ \&" +.TH "UV" "1" "05/26/2021" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -421,6 +421,15 @@ address destination address .if n \{\ .RE .\} +.SH "ENVIRONMENT VARIABLES" +.PP +\fBULTRAGRID_VERBOSE\fR +.RS 4 +If is +ULTRAGRID_VERBOSE +environment variable is set, default UltraGrid log level is +verbose\&. Command\-line option always overrides this value\&. +.RE .SH "REPORTING BUGS" .sp Report bugs to \fBultragrid\-dev@cesnet\&.cz\fR or use project \fBGitHub\fR to describe issues\&. diff --git a/src/debug.cpp b/src/debug.cpp index a2b19fbd0..be768bf34 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -234,6 +234,10 @@ bool set_log_level(const char *optarg, bool *logger_repeat_msgs) { *logger_repeat_msgs = true; } + if (getenv("ULTRAGRID_VERBOSE") != nullptr) { + log_level = LOG_LEVEL_VERBOSE; + } + if (optarg[0] == '+') { return true; }