#include <dirent.h>
#include <uci.h>
+#include <plp/log.h>
#include "common.h"
#include "process_parser.h"
len++;
}
ret_val->arg_arr[ret_val->count] = strndup(start, len);
- printf("ret_val[%d] = %s\n", ret_val->count, ret_val->arg_arr[ret_val->count]);
+ log_debug("ret_val[%d] = %s\n", ret_val->count, ret_val->arg_arr[ret_val->count]);
ret_val->count = ret_val->count + 1;
}
else {
option = uci_lookup_option(ctx, section, "ExecStart");
switch (option->type) {
case UCI_TYPE_STRING:
- printf("config file: %s name: %s, value: %s\n", *config_file, option->e.name, option->v.string);
+ log_info("config file: %s name: %s, value: %s\n", *config_file, option->e.name, option->v.string);
add_process_config(ret_val, option);
break;
default:
+ log_error("config file: can not parse parameter value");
break;
}
}
free(config_list);
}
else {
- printf("Failed to read service configurations from directory: %s\n", CONST_SERVICE_DIRECTORY_LOCATION);
+ log_error("Failed to read service configurations from directory: %s\n", CONST_SERVICE_DIRECTORY_LOCATION);
}
uci_free_context(ctx);
}
else {
- printf("Failed to read service configurations from directory: %s\n Memory allocation error.", CONST_SERVICE_DIRECTORY_LOCATION);
+ log_error("Failed to read service configurations from directory: %s\n Memory allocation error.", CONST_SERVICE_DIRECTORY_LOCATION);
}
return ret_val;
}