if (--mod->refcount > 0)
return mod;
- dbg(mod->ctx, "kmod_loaded %p released\n", mod);
+ DBG(mod->ctx, "kmod_loaded %p released\n", mod);
kmod_unref(mod->ctx);
loaded_modules_free(mod);
err = delete_module(m->name, flags);
if (err != 0) {
- err(mod->ctx, "Removing '%s': %s\n", m->name,
+ ERR(mod->ctx, "Removing '%s': %s\n", m->name,
strerror(-err));
return err;
}
#ifdef ENABLE_LOGGING
# ifdef ENABLE_DEBUG
-# define dbg(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg)
+# define DBG(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg)
# else
-# define dbg(ctx, arg...) kmod_log_null(ctx, ## arg)
+# define DBG(ctx, arg...) kmod_log_null(ctx, ## arg)
# endif
-# define info(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg)
-# define err(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg)
+# define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg)
+# define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg)
#else
-# define dbg(ctx, arg...) kmod_log_null(ctx, ## arg)
-# define info(ctx, arg...) kmod_log_null(ctx, ## arg)
-# define err(ctx, arg...) kmod_log_null(ctx, ## arg)
+# define DBG(ctx, arg...) kmod_log_null(ctx, ## arg)
+# define INFO(ctx, arg...) kmod_log_null(ctx, ## arg)
+# define ERR(ctx, arg...) kmod_log_null(ctx, ## arg)
#endif
#define KMOD_EXPORT __attribute__ ((visibility("default")))
if (env != NULL)
kmod_set_log_priority(ctx, log_priority(env));
- info(ctx, "ctx %p created\n", ctx);
- dbg(ctx, "log_priority=%d\n", ctx->log_priority);
+ INFO(ctx, "ctx %p created\n", ctx);
+ DBG(ctx, "log_priority=%d\n", ctx->log_priority);
return ctx;
}
if (--ctx->refcount > 0)
return ctx;
- info(ctx, "context %p released\n", ctx);
+ INFO(ctx, "context %p released\n", ctx);
free((char *)ctx->dirname);
free(ctx);
return NULL;
const char *format, va_list args))
{
ctx->log_fn = log_fn;
- info(ctx, "custom logging function %p registered\n", log_fn);
+ INFO(ctx, "custom logging function %p registered\n", log_fn);
}
/**