Remove setting log level for a module, implement
setting log level for a destination
This commit is contained in:
+9
-19
@@ -294,6 +294,15 @@ void uc_log_delete_destination(struct uc_log_destination *dest)
|
||||
pthread_mutex_unlock(&g_log_lock);
|
||||
}
|
||||
|
||||
void uc_log_destination_set_loglevel(struct uc_log_destination *dest, enum UC_LOG_LEVEL level)
|
||||
{
|
||||
pthread_mutex_lock(&g_log_lock);
|
||||
|
||||
dest->log_level = level;
|
||||
|
||||
pthread_mutex_unlock(&g_log_lock);
|
||||
}
|
||||
|
||||
static int uc_log_reopen_file(struct uc_log_destination *dest)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -337,25 +346,6 @@ void uc_log_init(struct uc_log_modules *user_modules)
|
||||
g_modules = *user_modules;
|
||||
}
|
||||
|
||||
int uc_log_module_set_loglevel(int module, enum UC_LOG_LEVEL level)
|
||||
{
|
||||
int rc = -1;
|
||||
int i;
|
||||
|
||||
pthread_mutex_lock(&g_log_lock);
|
||||
|
||||
for (i = 0; i < g_modules.cnt; i++) {
|
||||
if (g_modules.mods[i].id == module) {
|
||||
g_modules.mods[i].log_level = level;
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_log_lock);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline void uc_vlog_file(const struct uc_log_args *args, const char *fmt, va_list ap)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user