Revert "Check data from getenv("LIBNFC_LOG_LEVEL") and config file"

This reverts commit 846189b62c.
It didn't solve Coverity somplain and it broke bitfield support of log_level
This commit is contained in:
Philippe Teuwen 2013-09-22 19:55:31 +02:00
parent 846189b62c
commit 252f590d5c
3 changed files with 3 additions and 12 deletions

View file

@ -125,10 +125,7 @@ conf_keyvalue_context(void *data, const char *key, const char *value)
} else if (strcmp(key, "allow_intrusive_scan") == 0) {
string_as_boolean(value, &(context->allow_intrusive_scan));
} else if (strcmp(key, "log_level") == 0) {
int i = atoi(value);
if (i < 0) i = 0;
if (i > 3) i = 3;
context->log_level = i;
context->log_level = atoi(value);
} else if (strcmp(key, "device.name") == 0) {
if ((context->user_defined_device_count == 0) || strcmp(context->user_defined_devices[context->user_defined_device_count - 1].name, "") != 0) {
if (context->user_defined_device_count >= MAX_USER_DEFINED_DEVICES) {

View file

@ -87,10 +87,7 @@ log_put(const uint8_t group, const char *category, const uint8_t priority, const
log_level = 1;
#endif
} else {
int i = atoi(env_log_level);
if (i < 0) i = 0;
if (i > 3) i = 3;
log_level = i;
log_level = atoi(env_log_level);
}
// printf("log_level = %"PRIu32" group = %"PRIu8" priority = %"PRIu8"\n", log_level, group, priority);

View file

@ -121,10 +121,7 @@ nfc_context_new(void)
// log level
envvar = getenv("LIBNFC_LOG_LEVEL");
if (envvar) {
int i = atoi(envvar);
if (i < 0) i = 0;
if (i > 3) i = 3;
res->log_level = i;
res->log_level = atoi(envvar);
}
#endif // ENVVARS