file = eina_module_file_get(m);
if (!eina_module_load(m))
{
- ERR("could not load module \"%s\": %s\n",
+ ERR("could not load module \"%s\": %s",
file, eina_error_msg_get(eina_error_get()));
return EINA_FALSE;
}
plugin_get = eina_module_symbol_get(m, "ethumb_plugin_get");
if (!plugin_get)
{
- ERR("could not find ethumb_plugin_get() in module \"%s\": %s\n",
+ ERR("could not find ethumb_plugin_get() in module \"%s\": %s",
file, eina_error_msg_get(eina_error_get()));
eina_module_unload(m);
return EINA_FALSE;
plugin = plugin_get();
if (!plugin)
{
- ERR("plugin \"%s\" failed to init.\n", file);
+ ERR("plugin \"%s\" failed to init.", file);
eina_module_unload(m);
return EINA_FALSE;
}
- DBG("loaded plugin \"%s\" (%p) with extensions:\n", file, plugin);
+ DBG("loaded plugin \"%s\" (%p) with extensions:", file, plugin);
for (ext = plugin->extensions; *ext; ext++)
{
- DBG(" extension \"%s\"\n", *ext);
+ DBG(" extension \"%s\"", *ext);
eina_hash_add(_plugins_ext, *ext, plugin);
}
e = ecore_evas_get(ee);
if (!e)
{
- ERR("could not create ecore evas buffer\n");
+ ERR("could not create ecore evas buffer");
return NULL;
}
o = ecore_evas_object_image_new(ee);
if (!o)
{
- ERR("could not create sub ecore evas buffer\n");
+ ERR("could not create sub ecore evas buffer");
ecore_evas_free(ee);
free(ethumb);
return NULL;
img = evas_object_image_add(sub_e);
if (!img)
{
- ERR("could not create source objects.\n");
+ ERR("could not create source objects.");
ecore_evas_free(ee);
free(ethumb);
return NULL;
ethumb->o = o;
ethumb->img = img;
- DBG("ethumb=%p\n", ethumb);
+ DBG("ethumb=%p", ethumb);
return ethumb;
}
frame = calloc(1, sizeof(Ethumb_Frame));
if (!frame)
{
- ERR("could not allocate Ethumb_Frame structure.\n");
+ ERR("could not allocate Ethumb_Frame structure.");
return EINA_FALSE;
}
frame->edje = edje_object_add(e->sub_e);
if (!frame->edje)
{
- ERR("could not create edje frame object.\n");
+ ERR("could not create edje frame object.");
_ethumb_frame_free(frame);
e->frame = NULL;
return EINA_FALSE;
if (!edje_object_file_set(frame->edje, theme_file, group))
{
- ERR("could not load frame theme.\n");
+ ERR("could not load frame theme.");
_ethumb_frame_free(frame);
e->frame = NULL;
return EINA_FALSE;
edje_object_part_swallow(frame->edje, swallow, e->img);
if (!edje_object_part_swallow_get(frame->edje, swallow))
{
- ERR("could not swallow image to edje frame.\n");
+ ERR("could not swallow image to edje frame.");
_ethumb_frame_free(frame);
e->frame = NULL;
return EINA_FALSE;
DBG("ethumb=%p, path=%s, key=%s", e, path ? path : "", key ? key : "");
if (path && access(path, R_OK))
{
- ERR("couldn't access file \"%s\"\n", path);
+ ERR("couldn't access file \"%s\"", path);
return EINA_FALSE;
}
}
md5out[2 * n] = '\0';
- DBG("md5=%s, file=%s\n", md5out, file);
+ DBG("md5=%s, file=%s", md5out, file);
return eina_stringshare_add(md5out);
}
ext = strrchr(e->src_path, '.');
if (!ext)
{
- ERR("could not get extension for file \"%s\"\n", e->src_path);
+ ERR("could not get extension for file \"%s\"", e->src_path);
return EINA_FALSE;
}
plugin = eina_hash_find(_plugins_ext, ext + 1);
if (!plugin)
{
- DBG("no plugin for extension: \"%s\"\n", ext + 1);
+ DBG("no plugin for extension: \"%s\"", ext + 1);
return EINA_FALSE;
}
if (!e->thumb_path)
{
- ERR("could not create file path...\n");
+ ERR("could not create file path...");
return EINA_FALSE;
}
free(dname);
if (!r)
{
- ERR("could not create directory '%s'\n", dname);
+ ERR("could not create directory '%s'", dname);
return EINA_FALSE;
}
if (!r)
{
- ERR("could not save image.\n");
+ ERR("could not save image.");
return EINA_FALSE;
}
error = evas_object_image_load_error_get(img);
if (error != EVAS_LOAD_ERROR_NONE)
{
- ERR("could not load image '%s': %d\n", e->src_path, error);
+ ERR("could not load image '%s': %d", e->src_path, error);
return 0;
}
if (e->finished_idler)
{
- ERR("thumbnail generation already in progress.\n");
+ ERR("thumbnail generation already in progress.");
return EINA_FALSE;
}
e->finished_cb = finished_cb;
if (!e->src_path)
{
- ERR("no file set.\n");
+ ERR("no file set.");
ethumb_finished_callback_call(e, 0);
return EINA_TRUE;
}
if (!_ethumb_image_load(e))
{
- ERR("could not load input image.\n");
+ ERR("could not load input image.");
ethumb_finished_callback_call(e, 0);
return EINA_TRUE;
}
EINA_SAFETY_ON_TRUE_RETURN_VAL(r_src, 0);
if (r_thumb && errno != ENOENT)
- ERR("could not access file \"%s\": %s\n", e->thumb_path, strerror(errno));
+ ERR("could not access file \"%s\": %s", e->thumb_path, strerror(errno));
else if (!r_thumb && thumb.st_mtime > src.st_mtime)
r = EINA_TRUE;
#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
+#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_dom, __VA_ARGS__)
struct _Ethumb_Client
{
{
if (!msg)
{
- ERR("%s:%d:%s() callback without message arguments!\n",
+ ERR("%s:%d:%s() callback without message arguments!",
file, line, function);
if (err)
ERR("%s:%d:%s() an error was reported by server: "
- "name=\"%s\", message=\"%s\"\n",
+ "name=\"%s\", message=\"%s\"",
file, line, function, err->name, err->message);
return 0;
if (!dbus_message_iter_init(msg, itr))
{
- ERR("%s:%d:%s() could not init iterator.\n",
+ ERR("%s:%d:%s() could not init iterator.",
file, line, function);
return 0;
}
if (type == expected)
return 1;
- ERR("expected type %s (%c) but got %c instead!\n",
+ ERR("expected type %s (%c) but got %c instead!",
expected_name, expected, type);
return 0;
{ \
if ((ptr) == NULL) \
{ \
- ERR("%s == NULL!\n", #ptr); \
+ CRITICAL("%s == NULL!", #ptr); \
return __VA_ARGS__; \
} \
} \
DBUS_TYPE_STRING, &to,
DBUS_TYPE_INVALID))
{
- ERR("could not get NameOwnerChanged arguments: %s: %s\n",
+ ERR("could not get NameOwnerChanged arguments: %s: %s",
err.name, err.message);
dbus_error_free(&err);
return;
if (strcmp(name, _ethumb_dbus_bus_name) != 0)
return;
- DBG("NameOwnerChanged from=[%s] to=[%s]\n", from, to);
+ DBG("NameOwnerChanged from=[%s] to=[%s]", from, to);
if (from[0] != '\0' && to[0] == '\0')
{
- DBG("exit ethumbd at %s\n", from);
+ DBG("exit ethumbd at %s", from);
if (strcmp(client->unique_name, from) != 0)
- WRN("%s was not the known name %s, ignored.\n",
+ WRN("%s was not the known name %s, ignored.",
from, client->unique_name);
else
{
- ERR("server exit!!!\n");
+ ERR("server exit!!!");
if (client->die.cb)
{
client->die.cb(client->die.data, client);
}
}
else
- DBG("unknown change from %s to %s\n", from, to);
+ DBG("unknown change from %s to %s", from, to);
}
static void
dbus_message_iter_get_basic(&iter, &ret);
if ((ret != 1) && (ret != 2))
{
- ERR("Error starting Ethumbd DBus service by its name: retcode %u\n",
+ ERR("Error starting Ethumbd DBus service by its name: retcode %u",
ret);
goto error;
}
client->server_started = 1;
- DBG("Ethumbd DBus service started successfully (%d), now request its name\n",
+ DBG("Ethumbd DBus service started successfully (%d), now request its name",
ret);
if (client->pending_get_name_owner)
{
- DBG("already requesting name owner, cancel and try again\n");
+ DBG("already requesting name owner, cancel and try again");
dbus_pending_call_cancel(client->pending_get_name_owner);
}
client);
if (!client->pending_get_name_owner)
{
- ERR("could not create a get_name_owner request.\n");
+ ERR("could not create a get_name_owner request.");
goto error;
}
return;
error:
- ERR("failed to start Ethumbd DBus service by its name.\n");
+ ERR("failed to start Ethumbd DBus service by its name.");
_ethumb_client_report_connect(client, 0);
}
{
if (client->pending_start_service_by_name)
{
- DBG("already pending start service by name.\n");
+ DBG("already pending start service by name.");
return;
}
client);
if (!client->pending_start_service_by_name)
{
- ERR("could not start service by name!\n");
+ ERR("could not start service by name!");
_ethumb_client_report_connect(client, 0);
}
}
if (dbus_error_is_set(err) && (!client->server_started))
{
- DBG("could not find server (%s), try to start it...\n", err->message);
+ DBG("could not find server (%s), try to start it...", err->message);
_ethumb_client_start_server(client);
return;
}
dbus_message_iter_get_basic(&iter, &uid);
if (!uid)
{
- ERR("no name owner!\n");
+ ERR("no name owner!");
goto error;
}
- DBG("unique name = %s\n", uid);
+ DBG("unique name = %s", uid);
client->unique_name = eina_stringshare_add(uid);
_ethumb_client_call_new(client);
eclient = calloc(1, sizeof(*eclient));
if (!eclient)
{
- ERR("could not allocate Ethumb_Client structure.\n");
+ ERR("could not allocate Ethumb_Client structure.");
goto err;
}
eclient->ethumb = ethumb_new();
if (!eclient->ethumb)
{
- ERR("could not create ethumb handler.\n");
+ ERR("could not create ethumb handler.");
goto ethumb_new_err;
}
eclient->conn = e_dbus_bus_get(DBUS_BUS_SESSION);
if (!eclient->conn)
{
- ERR("could not connect to session bus.\n");
+ ERR("could not connect to session bus.");
goto connection_err;
}
eclient);
if (!eclient->pending_get_name_owner)
{
- ERR("could not create a get_name_owner request.\n");
+ ERR("could not create a get_name_owner request.");
goto connection_err;
}
el_type = dbus_message_iter_get_element_type(iter);
if (el_type != DBUS_TYPE_BYTE)
{
- ERR("not an byte array element.\n");
+ ERR("not an byte array element.");
return NULL;
}
ethumb_file_get(client->ethumb, &file, &key);
if (!file)
{
- ERR("no file set.\n");
+ ERR("no file set.");
return -1;
}