commit c485034d7916a90354361ad56b37b98313dd2909
parent b6d4feddc709c7e750a2c94bdf921304d52d6357
Author: Dominik Schmidt <dominik@schm1dt.ch>
Date: Sat, 16 Nov 2019 17:57:50 +0100
Make the log-level specifyable via environment variable.
Diffstat:
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/siproc.1 b/siproc.1
@@ -49,6 +49,9 @@ The password of the account
The port used by siproc. This variable is optional, and defaults to 5060.
If you want to run multiple instances of siproc on the same machine, set
it to distinct values, since the softphone binds to it.
+.TP
+.B SIPROC_LOG_LEVEL
+The verbosity of the pjsua-library. Smaller values yield less noise on stdout.
.
.SS SUBPROCESS ENVIRONMENT VARIABLES
The processes spawned by siproc are passed the following environment variables:
diff --git a/src/siproc.cpp b/src/siproc.cpp
@@ -539,6 +539,7 @@ int main(int argc, char **argv){
try{
ep.libCreate();
EpConfig ep_cfg;
+ ep_cfg.logConfig.level = atoi(env_or_default("SIPROC_LOG_LEVEL", "5"));;
ep.libInit(ep_cfg);
AudDevManager &adm = ep.audDevManager();
adm.setNullDev();