#include <stdio.h>
#include <unistd.h>
#include <glib.h>
+#include "util.h"
+#include "plugin.h"
static const char *MODULE_LIST = "/proc/modules";
gboolean mtetherd_scan_modules(const char *module) {
- g_message("Scanning %s", MODULE_LIST);
+ g_log(MTETHERD_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "Scanning %s", MODULE_LIST);
FILE *fp = fopen(MODULE_LIST, "r");
if (!fp) {
gboolean found = FALSE;
char *line = NULL;
while (!found && getline(&line, NULL, fp) != -1) {
- g_debug("Checking if '%s' starts with %s...", line, module);
+ g_log(MTETHERD_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Checking if '%s' starts with %s...", line, module);
if (g_str_has_prefix(line, module) == 0) {
- g_message("Found %s", module);
+ g_log(MTETHERD_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "Found %s", module);
found = TRUE;
}
free(line);