Commit 7f1d4f70 authored by atraczyk's avatar atraczyk Committed by gerrit2

build: use of gentenv is not permitted on UWP apps

- Removes the usage of getenv for log levels on UWP apps, as
  the notion of environment variables doesn't exist for apps, and
  getenv is not included in the UWP API.

Change-Id: Ifd1e981d9c3fafd64422251a38d991150e8a6fb8
Tuleap: #790
parent f53ef987
......@@ -134,6 +134,7 @@ static constexpr const char* DHTLOGLEVEL = "DHTLOGLEVEL";
static void
setDhtLogLevel()
{
#ifndef RING_UWP
char* envvar = getenv(DHTLOGLEVEL);
int level = 0;
......@@ -146,6 +147,9 @@ setDhtLogLevel()
RING_DBG("DHTLOGLEVEL=%u", level);
}
Manager::instance().dhtLogLevel = level;
#else
Manager::instance().dhtLogLevel = 0;
#endif
}
/**
......@@ -160,7 +164,9 @@ static constexpr const char* SIPLOGLEVEL = "SIPLOGLEVEL";
static void
setSipLogLevel()
{
#ifndef RING_UWP
char* envvar = getenv(SIPLOGLEVEL);
int level = 0;
if (envvar != nullptr) {
......@@ -172,6 +178,9 @@ setSipLogLevel()
}
pj_log_set_level(level);
#else
pj_log_set_level(0);
#endif
}
/**
......@@ -191,6 +200,7 @@ tls_print_logs(int level, const char* msg)
static void
setGnuTlsLogLevel()
{
#ifndef RING_UWP
char* envvar = getenv("RING_TLS_LOGLEVEL");
int level = RING_TLS_LOGLEVEL;
......@@ -204,6 +214,9 @@ setGnuTlsLogLevel()
}
gnutls_global_set_log_level(level);
#else
gnutls_global_set_log_level(RING_TLS_LOGLEVEL);
#endif
gnutls_global_set_log_function(tls_print_logs);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment