Patch from Mathieu Taillefumier.
SVN revision: 44637
if (!(e = ecore_config_get(key)))
{
- fprintf(stderr, "No such property\n");
+ EINA_LOG_ERR("No such property");
return -1;
}
temp = ecore_config_theme_get(key);
break;
default:
- fprintf(stderr, "Property has unrecognized type");
+ EINA_LOG_ERR("Property has unrecognized type");
return -1;
}
if(temp)
float f;
file = key = prog = NULL;
-
+ eina_init();
prog = strdup(argv[0]);
if(argc < 4)
if(ecore_config_init("econfig") != ECORE_CONFIG_ERR_SUCC)
{
- fprintf(stderr, "Couldn't init ecore_config!");
+ EINA_LOG_ERR("Couldn't init ecore_config!");
return 1;
}
if (list(file)) ret = 1;
break;
default:
- printf("Unhandled command '%c'\n", cmd);
+ EINA_LOG_ERR("Unhandled command '%c'", cmd);
}
ecore_config_shutdown();
if(file)
free(file);
-
+ eina_shutdown();
return ret;
}
#else
static const char *_ecore_magic_string_get(Ecore_Magic m);
static int _ecore_init_count = 0;
-
+EAPI int _ecore_log_dom = -1;
int _ecore_fps_debug = 0;
/** OpenBSD does not define CODESET
/*
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
{
- printf("WARNING: not a utf8 locale!\n");
+ WRN("Not a utf8 locale!");
}
*/
#ifdef HAVE_EVIL
#endif
if (!eina_init())
goto shutdown_evil;
+ _ecore_log_dom = eina_log_domain_register("Ecore",ECORE_DEFAULT_LOG_COLOR);
+ if (_ecore_log_dom < 0) {
+ EINA_LOG_ERR("Ecore was unable to create a log domain.");
+ goto shutdown_log_dom;
+ }
if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
if (_ecore_fps_debug) _ecore_fps_debug_init();
_ecore_signal_init();
return _ecore_init_count;
+ shutdown_log_dom:
+ eina_shutdown();
shutdown_evil:
#ifdef HAVE_EVIL
evil_shutdown();
_ecore_event_shutdown();
_ecore_main_shutdown();
_ecore_signal_shutdown();
+ eina_log_domain_unregister(_ecore_log_dom);
+ _ecore_log_dom = -1;
eina_shutdown();
#ifdef HAVE_EVIL
evil_shutdown();
EAPI void
_ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname)
{
- fprintf(stderr,
- "\n"
- "*** ECORE ERROR: Ecore Magic Check Failed!!!\n"
- "*** IN FUNCTION: %s()\n", fname);
+ ERR("\n"
+ "*** ECORE ERROR: Ecore Magic Check Failed!!!\n"
+ "*** IN FUNCTION: %s()", fname);
if (!d)
- fprintf(stderr, " Input handle pointer is NULL!\n");
+ ERR(" Input handle pointer is NULL!");
else if (m == ECORE_MAGIC_NONE)
- fprintf(stderr, " Input handle has already been freed!\n");
+ ERR(" Input handle has already been freed!");
else if (m != req_m)
- fprintf(stderr, " Input handle is wrong type\n"
- " Expected: %08x - %s\n"
- " Supplied: %08x - %s\n",
- (unsigned int)req_m, _ecore_magic_string_get(req_m),
- (unsigned int)m, _ecore_magic_string_get(m));
- fprintf(stderr,
- "*** NAUGHTY PROGRAMMER!!!\n"
- "*** SPANK SPANK SPANK!!!\n"
- "*** Now go fix your code. Tut tut tut!\n"
- "\n");
+ ERR(" Input handle is wrong type\n"
+ " Expected: %08x - %s\n"
+ " Supplied: %08x - %s",
+ (unsigned int)req_m, _ecore_magic_string_get(req_m),
+ (unsigned int)m, _ecore_magic_string_get(m));
+ ERR("*** NAUGHTY PROGRAMMER!!!\n"
+ "*** SPANK SPANK SPANK!!!\n"
+ "*** Now go fix your code. Tut tut tut!");
if (getenv("ECORE_ERROR_ABORT")) abort();
}
case EAGAIN:
case EINTR:
{ /* Not now, try later. */
- fprintf(stderr, "*** Must try again in %s @%u.\n", file, line);
+ ERR("*** Must try again in %s @%u.", file, line);
result = -1;
break;
}
case ENFILE:
case ENOLCK:
{ /* Low on resources. */
- fprintf(stderr, "*** Low on resources in %s @%u.\n", file,
- line);
+ ERR("*** Low on resources in %s @%u.", file,
+ line);
result = 0;
break;
}
case EIO:
{ /* I/O error. */
- fprintf(stderr, "*** I/O error in %s @%u.\n", file, line);
+ ERR("*** I/O error in %s @%u.", file, line);
result = 0;
break;
}
case EPERM:
case EBUSY:
{ /* Programmer fucked up. */
- fprintf(stderr,
- "*** NAUGHTY PROGRAMMER!!!\n"
- "*** SPANK SPANK SPANK!!!\n"
- "*** Now go fix your code in %s @%u. Tut tut tut!\n"
- "\n", file, line);
+ ERR("*** NAUGHTY PROGRAMMER!!!\n"
+ "*** SPANK SPANK SPANK!!!\n"
+ "*** Now go fix your code in %s @%u. Tut tut tut!",
+ file, line);
result = 0;
break;
}
default:
{ /* Unsupported errno code, please add this one. */
- fprintf(stderr,
- "*** NAUGHTY PROGRAMMER!!!\n"
- "*** SPANK SPANK SPANK!!!\n"
- "*** Unsupported errno code %d, please add this one.\n"
- "*** Now go fix your code in %s @%u, from %s @%u. Tut tut tut!\n"
- "\n", saved_errno, __FILE__, __LINE__, file, line);
- result = 0;
+ ERR("*** NAUGHTY PROGRAMMER!!!\n"
+ "*** SPANK SPANK SPANK!!!\n"
+ "*** Unsupported errno code %d, please add this one.\n"
+ "*** Now go fix your code in %s @%u, from %s @%u. Tut tut tut!",
+ saved_errno, __FILE__, __LINE__, file, line);
+ result = 0;
break;
}
}
if (pid == -1)
{
- fprintf(stderr, "Failed to fork process\n");
+ ERR("Failed to fork process");
pid = 0;
}
else if (pid == 0) /* child */
if (vfork_exec_errno != 0)
{
n = vfork_exec_errno;
- fprintf(stderr, "Could not start \"%s\"\n",
- exe_cmd);
+ ERR("Could not start \"%s\"",
+ exe_cmd);
pid = 0;
}
break;
if (e) /* Send the event. */
ecore_event_add(ECORE_EXE_EVENT_ADD, e,
_ecore_exe_event_add_free, NULL);
- /* printf("Running as %d for %s.\n", exe->pid, exe->cmd); */
+ /* INF("Running as %d for %s.\n", exe->pid, exe->cmd); */
}
errno = n;
return;
}
_ecore_exe_dead_attach(exe);
- printf("Sending TERM signal to %s (%d).\n", exe->cmd, exe->pid);
+ INF("Sending TERM signal to %s (%d).", exe->cmd, exe->pid);
kill(exe->pid, SIGTERM);
}
ecore_timer_add(10.0, _ecore_exe_make_sure_its_really_dead, dead);
}
- printf("Sending KILL signal to %s (%d).\n", exe->cmd, exe->pid);
+ INF("Sending KILL signal to %s (%d).", exe->cmd, exe->pid);
kill(exe->pid, SIGKILL);
}
if ((exe = _ecore_exe_is_it_alive(dead->pid)) != NULL)
{
if (dead->cmd)
- printf("Sending KILL signal to alledgedly dead %s (%d).\n",
+ INF("Sending KILL signal to alledgedly dead %s (%d).",
dead->cmd, dead->pid);
else
- printf("Sending KILL signal to alledgedly dead PID %d.\n",
- dead->pid);
+ INF("Sending KILL signal to alledgedly dead PID %d.",
+ dead->pid);
exe->doomsday_clock =
ecore_timer_add(10.0, _ecore_exe_make_sure_its_really_dead,
dead);
if ((exe = _ecore_exe_is_it_alive(dead->pid)) != NULL)
{
- printf
- ("RUN! The zombie wants to eat your brains! And your CPU!\n");
+ ERR("RUN! The zombie wants to eat your brains! And your CPU!");
if (dead->cmd)
- printf("%s (%d) is not really dead.\n", dead->cmd, dead->pid);
+ INF("%s (%d) is not really dead.", dead->cmd, dead->pid);
else
- printf("PID %d is not really dead.\n", dead->pid);
+ INF("PID %d is not really dead.", dead->pid);
exe->doomsday_clock = NULL;
}
IF_FREE(dead->cmd);
if (flags & ECORE_EXE_PIPE_READ)
{
if (exe->read_data_size)
- printf
- ("There are %d bytes left unsent from the dead exe %s.\n",
+ INF("There are %d bytes left unsent from the dead exe %s.",
exe->read_data_size, exe->cmd);
}
else
{
if (exe->error_data_size)
- printf
- ("There are %d bytes left unsent from the dead exe %s.\n",
+ INF("There are %d bytes left unsent from the dead exe %s.",
exe->error_data_size, exe->cmd);
}
/* Thought about this a bit. If the exe has actually
int ok = 0;
int result;
- printf("Closing stdin for %s\n", exe->cmd);
+ INF("Closing stdin for %s", exe->cmd);
/* if (exe->child_fd_write != -1) E_NO_ERRNO(result, fsync(exe->child_fd_write), ok); This a) doesn't work, and b) isn't needed. */
IF_FN_DEL(ecore_main_fd_handler_del, exe->write_fd_handler);
if (exe->child_fd_write != -1)
#ifdef HAVE_GLIB
#include <glib.h>
+#include "ecore_private.h"
static Eina_Bool _ecore_glib_active = EINA_FALSE;
static int (*_ecore_glib_select_original)(int, fd_set*, fd_set*, fd_set*, struct timeval *);
void *tmp = realloc(_ecore_glib_fds, sizeof(GPollFD) * size);
if (!tmp)
{
- fprintf(stderr, "ERROR: Could not realloc from %zu to %zu buckets.\n",
- _ecore_glib_fds_size, size);
+ ERR("Could not realloc from %zu to %zu buckets.",
+ _ecore_glib_fds_size, size);
return EINA_FALSE;
}
Ecore_Hash_Node *node;
for (node = hash->buckets[i]; node; node = node->next)
n++;
- printf("%d\t%u\n", i, n);
+ INF("%d\t%u", i, n);
}
else
- printf("%d\t0\n", i);
+ INF("%d\t0", i);
}
/**
}
}
variance = (sum_n_2 - ((sum_n * sum_n) / (double)i)) / (double)i;
- printf("Average length: %f\n\tvariance^2: %f\n", (sum_n / (double)i),
+ INF("Average length: %f\n\tvariance^2: %f", (sum_n / (double)i),
variance);
}
{
if (in_main_loop)
{
- fprintf(stderr,
- "\n"
- "*** ECORE WARINING: Calling ecore_shutdown() while still in the main loop.\n"
- "*** Program may crash or behave strangely now.\n");
+ ERR("\n"
+ "*** ECORE WARINING: Calling ecore_shutdown() while still in the main loop.\n"
+ "*** Program may crash or behave strangely now.");
return;
}
while (fd_handlers)
static void
_ecore_main_fd_handlers_bads_rem(void)
{
- fprintf(stderr, "Removing bad fds\n");
+ ERR("Removing bad fds");
Ecore_Fd_Handler *fdh;
Eina_Inlist *l;
if ((fcntl(fdh->fd, F_GETFD) < 0) && (errno == EBADF))
{
- fprintf(stderr, "Found bad fd at index %d\n", fdh->fd);
+ ERR("Found bad fd at index %d", fdh->fd);
if (fdh->flags & ECORE_FD_ERROR)
{
- fprintf(stderr, "Fd set for error! calling user\n");
+ ERR("Fd set for error! calling user");
if (!fdh->func(fdh->data, fdh))
{
- fprintf(stderr, "Fd function err returned 0, remove it\n");
+ ERR("Fd function err returned 0, remove it");
fdh->delete_me = 1;
fd_handlers_delete_me = 1;
}
}
else
{
- fprintf(stderr, "Problematic fd found at %d! setting it for delete\n", fdh->fd);
+ ERR("Problematic fd found at %d! setting it for delete", fdh->fd);
fdh->delete_me = 1;
fd_handlers_delete_me = 1;
}
l = l->next;
if (fdh->delete_me)
{
-// fprintf(stderr, "Removing fd %d\n", fdh->fd);
+// ERR("Removing fd %d", fdh->fd);
fd_handlers = (Ecore_Fd_Handler *) eina_inlist_remove(EINA_INLIST_GET(fd_handlers),
EINA_INLIST_GET(fdh));
ECORE_MAGIC_SET(fdh, ECORE_MAGIC_NONE);
char *msg;
msg = evil_last_error_get();
- printf (" * %s\n", msg);
+ ERR(" * %s\n", msg);
free(msg);
res = -1;
}
else if (result == WAIT_TIMEOUT)
{
- printf ("time out\n");
+ ERR("time out\n");
res = 0;
}
else if (result == (WAIT_OBJECT_0 + objects_nbr))
}
else
{
- fprintf(stderr, "unknown result...\n");
+ ERR(stderr, "unknown result...\n");
res = -1;
}
else if (ret > 0)
{
/* XXX What should we do here? */
- fprintf(stderr, "The length of the data was not written complete"
- " to the pipe\n");
+ ERR("The length of the data was not written complete"
+ " to the pipe");
return FALSE;
}
else if (ret == PIPE_FD_ERROR && errno == EPIPE)
;
else
{
- fprintf(stderr, "An unhandled error (ret: %d errno: %d)"
- "occured while writing to the pipe the length\n",
- ret, errno);
+ ERR("An unhandled error (ret: %d errno: %d)"
+ "occured while writing to the pipe the length",
+ ret, errno);
}
}
while (retry--);
;
else
{
- fprintf(stderr, "An unhandled error (ret: %d errno: %d)"
- "occured while writing to the pipe the length\n",
- ret, errno);
+ ERR("An unhandled error (ret: %d errno: %d)"
+ "occured while writing to the pipe the length",
+ ret, errno);
}
}
while (retry--);
else if (ret > 0)
{
/* XXX What should we do here? */
- fprintf(stderr, "Only read %d bytes from the pipe, although"
- " we need to read %d bytes.\n", ret, sizeof(p->len));
+ ERR("Only read %d bytes from the pipe, although"
+ " we need to read %d bytes.", ret, sizeof(p->len));
}
else if (ret == 0)
{
return ECORE_CALLBACK_RENEW;
else
{
- fprintf(stderr, "An unhandled error (ret: %d errno: %d)"
- "occured while reading from the pipe the length\n",
- ret, errno);
+ ERR("An unhandled error (ret: %d errno: %d)"
+ "occured while reading from the pipe the length",
+ ret, errno);
return ECORE_CALLBACK_RENEW;
}
#else
return ECORE_CALLBACK_RENEW;
else
{
- fprintf(stderr, "An unhandled error (ret: %d errno: %d)"
- "occured while reading from the pipe the data\n",
- ret, errno);
+ ERR("An unhandled error (ret: %d errno: %d)"
+ "occured while reading from the pipe the data",
+ ret, errno);
return ECORE_CALLBACK_RENEW;
}
#else
# undef EAPI
#endif
+extern int _ecore_log_dom ;
+#ifdef _ECORE_DEFAULT_LOG_DOM
+# undef _ECORE_DEFAULT_LOG_DOM
+#endif
+#define _ECORE_DEFAULT_LOG_DOM _ecore_log_dom
+
+#ifdef ECORE_DEFAULT_LOG_COLOR
+# undef ECORE_DEFAULT_LOG_COLOR
+#endif
+#define ECORE_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ECORE_DEFAULT_LOG_DOM, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ECORE_DEFAULT_LOG_DOM, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ECORE_DEFAULT_LOG_DOM, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ECORE_DEFAULT_LOG_DOM, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ECORE_DEFAULT_LOG_DOM, __VA_ARGS__)
#ifdef _WIN32
# ifdef EFL_ECORE_BUILD
# ifdef DLL_EXPORT
#endif
sigprocmask(SIG_BLOCK, &newset, &oldset);
if (sigchld_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGCHLD in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigchld_count, MAXSIGQ);
+ WRN("%i SIGCHLD in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigchld_count, MAXSIGQ);
for (n = 0; n < sigchld_count; n++)
{
pid_t pid;
sigchld_count = 0;
if (sigusr1_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGUSR1 in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigusr1_count, MAXSIGQ);
+ WRN("%i SIGUSR1 in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigusr1_count, MAXSIGQ);
for (n = 0; n < sigusr1_count; n++)
{
Ecore_Event_Signal_User *e;
sigusr1_count = 0;
if (sigusr2_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGUSR2 in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigusr2_count, MAXSIGQ);
+ WRN("%i SIGUSR2 in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigusr2_count, MAXSIGQ);
for (n = 0; n < sigusr2_count; n++)
{
Ecore_Event_Signal_User *e;
sigusr2_count = 0;
if (sighup_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGHUP in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sighup_count, MAXSIGQ);
+ WRN("%i SIGHUP in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sighup_count, MAXSIGQ);
for (n = 0; n < sighup_count; n++)
{
Ecore_Event_Signal_Hup *e;
sighup_count = 0;
if (sigquit_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGQUIT in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigquit_count, MAXSIGQ);
+ WRN("%i SIGQUIT in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigquit_count, MAXSIGQ);
for (n = 0; n < sigquit_count; n++)
{
Ecore_Event_Signal_Exit *e;
sigquit_count = 0;
if (sigint_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGINT in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigint_count, MAXSIGQ);
+ WRN("%i SIGINT in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigint_count, MAXSIGQ);
for (n = 0; n < sigint_count; n++)
{
Ecore_Event_Signal_Exit *e;
sigint_count = 0;
if (sigterm_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGTERM in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigterm_count, MAXSIGQ);
+ WRN("%i SIGTERM in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigterm_count, MAXSIGQ);
for (n = 0; n < sigterm_count; n++)
{
Ecore_Event_Signal_Exit *e;
#ifdef SIGPWR
if (sigpwr_count > MAXSIGQ)
- printf("ECORE WARNING. %i SIGPWR in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", sigpwr_count, MAXSIGQ);
+ WRN("%i SIGPWR in queue. max queue size %i. losing "
+ "siginfo for extra signals.", sigpwr_count, MAXSIGQ);
for (n = 0; n < sigpwr_count; n++)
{
Ecore_Event_Signal_Power *e;
for (i = 0; i < num; i++)
{
if (sigrt_count[i] > MAXSIGQ)
- printf("ECORE WARNING. %i SIGRT%i in queue. max queue size %i. losing "
- "siginfo for extra signals.\n", i + 1, sigrt_count[i], MAXSIGQ);
+ WRN("%i SIGRT%i in queue. max queue size %i. losing "
+ "siginfo for extra signals.", i + 1, sigrt_count[i], MAXSIGQ);
for (n = 0; n < sigrt_count[i]; n++)
{
Ecore_Event_Signal_Realtime *e;
{
if (value < 0.0)
{
- fprintf(stderr, "ERROR: precision %f less than zero, ignored\n", value);
+ ERR("Precision %f less than zero, ignored", value);
return;
}
precision = value;
EAPI void
ecore_print_warning(const char *function, const char *sparam)
{
- fprintf(stderr, "***** Developer Warning ***** :\n"
- "\tThis program is calling:\n\n"
- "\t%s();\n\n"
- "\tWith the parameter:\n\n"
- "\t%s\n\n"
- "\tbeing NULL. Please fix your program.\n", function, sparam);
- fflush(stderr);
+ WRN("***** Developer Warning ***** :\n"
+ "\tThis program is calling:\n\n"
+ "\t%s();\n\n"
+ "\tWith the parameter:\n\n"
+ "\t%s\n\n"
+ "\tbeing NULL. Please fix your program.", function, sparam);
if (getenv("ECORE_ERROR_ABORT")) abort();
}
static Eina_List *servers = NULL;
static int _ecore_con_init_count = 0;
-
+int _ecore_con_log_dom = -1;
#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
#define LENGTH_OF_ABSTRACT_SOCKADDR_UN(s, path) (strlen(path) + 1 + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
if (!ecore_init())
return --_ecore_con_init_count;
+ _ecore_con_log_dom = eina_log_domain_register("EcoreCon", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_con_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain foe Ecore Con.");
+ ecore_shutdown();
+ return --_ecore_con_init_count;
+ }
ECORE_CON_EVENT_CLIENT_ADD = ecore_event_type_new();
ECORE_CON_EVENT_CLIENT_DEL = ecore_event_type_new();
ECORE_CON_EVENT_SERVER_ADD = ecore_event_type_new();
{
if (--_ecore_con_init_count != 0)
return _ecore_con_init_count;
-
+
while (servers)
_ecore_con_server_free(eina_list_data_get(servers));
ecore_con_info_shutdown();
ecore_con_dns_shutdown();
ecore_con_ssl_shutdown();
-
+ eina_log_domain_unregister(_ecore_con_log_dom);
+ _ecore_con_log_dom = -1;
ecore_shutdown();
return _ecore_con_init_count;
socket_unix.sun_path[0] = '\0';
socket_unix_len = LENGTH_OF_ABSTRACT_SOCKADDR_UN(&socket_unix, name);
#else
- fprintf(stderr, "Your system does not support abstract sockets!\n");
+ ERR("Your system does not support abstract sockets!");
goto error_umask;
#endif
}
socket_unix.sun_path[0] = '\0';
socket_unix_len = LENGTH_OF_ABSTRACT_SOCKADDR_UN(&socket_unix, name);
#else
- fprintf(stderr, "Your system does not support abstract sockets!\n");
+ WRN("Your system does not support abstract sockets!");
goto error;
#endif
}
t = ecore_time_get();
if ((t - t_start) > 0.5)
{
- printf("ECORE_CON: EEK - stuck in _ecore_con_server_free() trying\n"
- " to flush data out from the server, and have been for\n"
- " %1.1f seconds. This is taking too long. Aborting flush.\n",
- (t - t_start));
+ WRN("ECORE_CON: EEK - stuck in _ecore_con_server_free() trying\n"
+ " to flush data out from the server, and have been for\n"
+ " %1.1f seconds. This is taking too long. Aborting flush.",
+ (t - t_start));
break;
}
}
t = ecore_time_get();
if ((t - t_start) > 0.5)
{
- printf("ECORE_CON: EEK - stuck in _ecore_con_client_free() trying\n"
- " to flush data out from the client, and have been for\n"
- " %1.1f seconds. This is taking too long. Aborting flush.\n",
- (t - t_start));
+ WRN("EEK - stuck in _ecore_con_client_free() trying\n"
+ " to flush data out from the client, and have been for\n"
+ " %1.1f seconds. This is taking too long. Aborting flush.",
+ (t - t_start));
break;
}
}
#define READBUFSIZ 65536
+extern int _ecore_con_log_dom ;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_con_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_con_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_con_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_con_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_con_log_dom, __VA_ARGS__)
+
typedef enum _Ecore_Con_State
{
ECORE_CON_CONNECTED,
fclose((FILE*)stream);
return 0;
}
- fprintf(stderr, "*** We read %zu bytes from file\n", retcode);
+ INF("*** We read %zu bytes from file", retcode);
return retcode;
}
#include "ecore_config_ipc.h"
#include "ecore_config_util.h"
-
+int _ecore_config_log_dom = -1;
int DEBUG = 0;
EAPI Ecore_Config_Server *__ecore_config_server_global = NULL;
EAPI Ecore_Config_Server *__ecore_config_server_local = NULL;
val = NULL;
r = NULL;
if (!(e = ecore_config_get(key)))
- E(0, "no such property, \"%s\"...\n", key);
+ ERR(0, "no such property, \"%s\"...", key);
else
{
switch (e->type)
{
if ((e->val < e->lo))
{
- E(0,
- "ecore_config_bounds(\"%s\",%ld): value out of range; adjusted to %ld...\n",
+ WRN("ecore_config_bounds(\"%s\",%ld): value out of range; adjusted to %ld...",
e->key, e->val, e->lo);
e->val = e->lo;
}
else if ((e->val > e->hi))
{
- E(0,
- "ecore_config_bounds(\"%s\",%ld): value out of range; adjusted to %ld...\n",
+ WRN("ecore_config_bounds(\"%s\",%ld): value out of range; adjusted to %ld...",
e->key, e->val, e->hi);
e->val = e->hi;
}
if (v != e->val)
{
if (e->type == ECORE_CONFIG_FLT)
- E(0,
- "ecore_config_bound(\"%s\"): float value %f not a multiple of %f, adjusted to %f...\n",
+ WRN("ecore_config_bound(\"%s\"): float value %f not a multiple of %f, adjusted to %f...",
e->key, ((double)e->val) / ECORE_CONFIG_FLOAT_PRECISION,
((double)e->step) / ECORE_CONFIG_FLOAT_PRECISION,
((double)v) / ECORE_CONFIG_FLOAT_PRECISION);
else
- E(0,
- "ecore_config_bound(\"%s\"): integer value %ld not a multiple of %ld, adjusted to %ld...\n",
+ WRN("ecore_config_bound(\"%s\"): integer value %ld not a multiple of %ld, adjusted to %ld...",
e->key, e->val, e->step, v);
ret = ECORE_CONFIG_ERR_SUCC;
e->val = v;
}
else
{
- E(0,
- "ecore_config_typed_set(\"%s\"): ecore_config_typed_val() failed: %d\n",
- key, ret);
+ ERR("ecore_config_typed_set(\"%s\"): ecore_config_typed_val() failed: %d",
+ key, ret);
}
return ret;
EAPI int
ecore_config_struct_create(const char *key)
{
- printf("WARNING: you are using ecore_config structures. These are very young");
- printf(" and not complete - you have been warned");
+ WRN("you are using ecore_config structures. These are very young");
+ WRN(" and not complete - you have been warned");
return ecore_config_typed_default(key, NULL, ECORE_CONFIG_SCT);
}
ptr += sizeof(int);
break;
default:
- printf("ARGH - STRUCT coding not implemented yet\n");
+ WRN("ARGH - STRUCT coding not implemented yet");
}
l = eina_list_next(l);
}
if (ret != ECORE_CONFIG_ERR_SUCC)
{
- E(0, "ecore_config_listen: ecore_config_add(\"%s\") failed: %d\n",
- key, ret);
+ ERR("ecore_config_listen: ecore_config_add(\"%s\") failed: %d",
+ key, ret);
return ret;
}
if (!(e = ecore_config_get(key)))
{
- E(0, "ecore_config_listen: list of properties corrupted!?\n");
+ ERR("ecore_config_listen: list of properties corrupted!?");
return ECORE_CONFIG_ERR_FAIL;
}
}
for (l = e->listeners; l; l = l->next)
if (!strcmp(l->name, name) || (l->listener == listener))
{
- E(1,
- "ecore_config_listen: %s is already listening for changes of %s...\n",
+ ERR("ecore_config_listen: %s is already listening for changes of %s...",
name, key);
return ECORE_CONFIG_ERR_IGNORED;
}
if (!(l = malloc(sizeof(Ecore_Config_Listener_List))))
return ECORE_CONFIG_ERR_OOM;
- E(1, "registering listener \"%s\" for \"%s\" (%d)...\n", name, key, e->type);
+ ERR("registering listener \"%s\" for \"%s\" (%d)...", name, key, e->type);
memset(l, 0, sizeof(Ecore_Config_Listener_List));
{
char *path;
Ecore_Config_Prop *list;
+ _ecore_config_log_dom = eina_log_domain_register("EcoreConfig", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_config_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore config module.");
+ return -1;
+ }
_ecore_config_system_init_no_load();
__ecore_config_app_name = strdup(name);
free(__ecore_config_bundle_local);
free(__ecore_config_server_local);
free(__ecore_config_server_global);
+ eina_log_domain_unregister(_ecore_config_log_dom);
+ _ecore_config_log_dom = -1;
return ret;
}
if(*l)
{
- E(0, "ecore_config_val: value \"%s\" not a valid hexadecimal RGB value?\n", argb);
+ ERR("ecore_config_val: value \"%s\" not a valid hexadecimal RGB value?", argb);
return NULL;
}
ecore_config_typed_set(key, (void *)value, type);
break;
case ECORE_CONFIG_SCT:
- printf("loading struct %s\n", key);
+ INF("loading struct %s", key);
break;
default:
- E(0, "Type %d not handled\n", type);
+ WRN("Type %d not handled", type);
}
free(data);
return 1;
val = _ecore_config_argbstr_get(e);
break;
default:
- E(0, "Type %d not handled\n", e->type);
+ WRN("Type %d not handled", e->type);
}
if (prev_locale)
#include "Ecore_Config.h"
#include "Ecore.h"
-
+#include "ecore_config_private.h"
typedef struct __Ecore_Config_Arg_Callback _Ecore_Config_Arg_Callback;
struct __Ecore_Config_Arg_Callback
{
_Ecore_Config_Arg_Callback *callbacks;
if (__ecore_config_app_description)
- printf("%s\n\n", __ecore_config_app_description);
- printf("Supported Options:\n");
- printf(" -h, --help\t Print this text\n");
+ ERR("%s\n\n", __ecore_config_app_description);
+ ERR("Supported Options:");
+ ERR(" -h, --help\t Print this text");
if (!__ecore_config_bundle_local)
return;
props = __ecore_config_bundle_local->data;
props = props->next;
continue;
}
- printf(" %c%c%c --%s\t%s %s\n", props->short_opt ? '-' : ' ',
+ INF(" %c%c%c --%s\t%s %s", props->short_opt ? '-' : ' ',
props->short_opt ? props->short_opt : ' ',
props->short_opt ? ',' : ' ',
props->long_opt ? props->long_opt : props->key,
callbacks = _ecore_config_arg_callbacks;
while (callbacks)
{
- printf(" %c%c%c --%s\t%s %s\n", callbacks->short_opt ? '-' : ' ',
+ INF(" %c%c%c --%s\t%s %s", callbacks->short_opt ? '-' : ' ',
callbacks->short_opt ? callbacks->short_opt : ' ',
callbacks->short_opt ? ',' : ' ',
callbacks->long_opt ? callbacks->long_opt : "",
if (!arg)
{
if (opt)
- printf("Missing expected argument for option --%s\n", opt);
+ ERR("Missing expected argument for option --%s", opt);
else
- printf("Missing expected argument for option -%c\n", opt2);
+ ERR("Missing expected argument for option -%c", opt2);
return ECORE_CONFIG_PARSE_EXIT;
}
else
if (*arg != '-')
{
- printf("Unexpected attribute \"%s\"\n", arg);
+ ERR("Unexpected attribute \"%s\"", arg);
nextarg++;
continue;
}
{
if (!argv[++nextarg])
{
- printf("Missing expected argument for option --%s\n", long_opt);
+ ERR("Missing expected argument for option --%s", long_opt);
return ECORE_CONFIG_PARSE_EXIT;
}
callback->func(argv[nextarg], callback->data);
}
if (!found)
{
- printf("Unrecognised option \"%s\"\n", long_opt);
- printf("Try using -h or --help for more information.\n\n");
+ ERR("Unrecognised option \"%s\"", long_opt);
+ ERR("Try using -h or --help for more information.\n");
return ECORE_CONFIG_PARSE_EXIT;
}
}
{
if (!argv[++nextarg])
{
- printf("Missing expected argument for option -%c\n", short_opt);
+ ERR("Missing expected argument for option -%c", short_opt);
return ECORE_CONFIG_PARSE_EXIT;
}
callback->func(argv[nextarg], callback->data);
}
if (!found)
{
- printf("Unrecognised option '%c'\n", short_opt);
- printf
- ("Try using -h or --help for more information.\n\n");
+ ERR("Unrecognised option '%c'", short_opt);
+ ERR("Try using -h or --help for more information.\n");
return ECORE_CONFIG_PARSE_EXIT;
}
}
*r = q;
q += l;
*m = q;
- E(1, "IPC/eCore: got string-%d \"%s\"\n", l, *r);
+ WRN("IPC/eCore: got string-%d \"%s\"", l, *r);
return ECORE_CONFIG_ERR_SUCC;
}
int len = reply ? strlen(reply) + 1 : 0;
our_ref++;
- E(1, "IPC/eCore: replying [0,0] %d IRT %d => %d {\"%s\":%d}\n", our_ref,
+ WRN("IPC/eCore: replying [0,0] %d IRT %d => %d {\"%s\":%d}", our_ref,
e->ref, code, reply ? reply : "", len);
return ecore_ipc_client_send(e->client, 0, 0, our_ref, e->ref, code, reply,
len);
serial = e->minor;
r = NULL;
m = (char *)e->data;
- E(1, "IPC/eCore: client sent: [%d,%d] #%d (%d) @ %p\n", e->major, e->minor,
+ INF("IPC/eCore: client sent: [%d,%d] #%d (%d) @ %p", e->major, e->minor,
e->ref, e->size, server);
switch (e->major)
if (*server != ecore_ipc_client_server_get(e->client))
return 1;
- E(1, "IPC/eCore: Client connected. @ %p\n", server);
+ INF("IPC/eCore: Client connected. @ %p", server);
return 1;
}
if (*server != ecore_ipc_client_server_get(e->client))
return 1;
- E(1, "IPC/eCore: Client disconnected. @ %p\n", server);
+ INF("IPC/eCore: Client disconnected. @ %p", server);
return 1;
}
if (!stat(socket, &st))
{
- E(0, "IPC/eCore: pipe \"%s\" already exists!?\n", socket);
+ INF("IPC/eCore: pipe \"%s\" already exists!?", socket);
/* if(unlink(buf))
E(0,"IPC/eCore: could not remove pipe \"%s\": %d\n",buf,errno); }}*/
port++;
if (server)
{
- E(1, "IPC/eCore: Server is listening on %s.\n", pipe_name);
+ INF("IPC/eCore: Server is listening on %s.", pipe_name);
}
return ECORE_CONFIG_ERR_SUCC;
theme = ecore_config_bundle_by_serial_get(srv, serial);
ret = ecore_config_set(key, (char *)val);
- E(1, "ipc.prop.set(%s->%s,\"%s\") => %d\n", theme ? theme->identifier : "",
- key, val, ret);
+ ERR("ipc.prop.set(%s->%s,\"%s\") => %d\n", theme ? theme->identifier : "",
+ key, val, ret);
return ret;
#else
return ECORE_CONFIG_ERR_NOTSUPP;
memset(list, 0, sizeof(Ecore_Config_Server));
if ((ret = _ecore_config_ipc_ecore_init(pipe_name, &list->server)) != ECORE_CONFIG_ERR_SUCC)
{
- E(2, "_ecore_config_ipc_init: failed to register %s, code %d\n",
+ ERR("_ecore_config_ipc_init: failed to register %s, code %d",
pipe_name, ret);
}
- E(2, "_ecore_config_ipc_init: registered \"%s\"...\n", pipe_name);
+ ERR("_ecore_config_ipc_init: registered \"%s\"...", pipe_name);
list->name = strdup(pipe_name);
list->next = __ecore_config_servers;
#ifndef _ECORE_CONFIG_PRIVATE_H
# define _ECORE_CONFIG_PRIVATE_H
+ /* eina_log related things */
+
+extern int _ecore_config_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_config_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_config_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_config_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_config_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_config_log_dom, __VA_ARGS__)
+
/* debug */
extern int DEBUG;
-#ifdef __sgi
-# define D
-# define E
-#else
-# define D(fmt,args...) do { if(DEBUG>=0) fprintf(stderr,fmt,## args); } while(0);
-# define E(lvl,args...) do { if(DEBUG>=(lvl)) fprintf(stderr,## args); } while(0)
-#endif
+
typedef struct _Ecore_Config_DB_File Ecore_Config_DB_File;
db = _ecore_config_db_open_read(file);
if (!db)
{
- E(0, "Cannot open database from file %s!\n", file);
+ ERR("Cannot open database from file %s!", file);
return ECORE_CONFIG_ERR_NODATA;
}
key_count = 0;
db = _ecore_config_db_open_write(file);
if (!db)
{
- E(0, "Cannot open database from file %s!\n", file);
+ ERR("Cannot open database from file %s!", file);
return ECORE_CONFIG_ERR_FAIL;
}
* - handle all event types
* -
* */
-
+int _ecore_directfb_log_dom = -1;
static int _ecore_directfb_init_count = 0;
static int _window_event_fd = 0;
if(!k)
{
- printf("error en el numero, %0X\n", evt->input.key_symbol);
+ ERR("error en el numero, %0X", evt->input.key_symbol);
return;
}
e->name = strdup(k->name);
if(!k)
{
- printf("error en el numero, %0X\n", evt->window.key_symbol);
+ ERR("error en el numero, %0X", evt->window.key_symbol);
return;
}
e->name = strdup(k->name);
if(!k)
{
- printf("error en el numero, %0X\n", evt->input.key_symbol);
+ ERR("error en el numero, %0X", evt->input.key_symbol);
return;
}
e->name = strdup(k->name);
if(!k)
{
- printf("error en el numero, %0X\n", evt->window.key_symbol);
+ ERR("error en el numero, %0X", evt->window.key_symbol);
return;
}
e->name = strdup(k->name);
if (v < 1) return 1;
if(evt.window.type & DWET_POSITION)
- printf("position\n");
+ INF("position");
if(evt.window.type & DWET_SIZE)
- printf("size\n");
+ INF("size");
if(evt.window.type & DWET_CLOSE)
- printf("close\n");
+ INF("close");
if(evt.window.type & DWET_DESTROYED)
- printf("destroyed\n");
+ INF("destroyed");
if(evt.window.type & DWET_GOTFOCUS)
_ecore_directfb_event_handle_got_focus(&evt.window);
if(evt.window.type & DWET_LOSTFOCUS)
int i = 0;
if (++_ecore_directfb_init_count != 1) return _ecore_directfb_init_count;
-
+ _ecore_directfb_log_dom = eina_log_domain_register("EcoreDirectFB", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_directfb_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore directFB module.");
+ return _ecore_directfb_init_count--;
+ }
DFBCHECK(DirectFBInit(NULL,NULL));
DFBCHECK(DirectFBCreate(&_dfb));
DFBCHECK(_window_event->Release(_window_event));
DFBCHECK(_layer->Release(_layer));
DFBCHECK(_dfb->Release(_dfb));
-
+ eina_log_domain_unregister(_ecore_directfb_log_dom);
+ _ecore_directfb_log_dom = -1;
return _ecore_directfb_init_count;
}
+
+/* eina_log related things */
+
+extern int _ecore_directfb_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_directfb_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_directfb_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_directfb_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_directfb_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_directfb_log_dom, __VA_ARGS__)
+
/* macro for a safe call to DirectFB functions */
#define DFBCHECK(x...) \
{ \
_err = x; \
if (_err != DFB_OK) { \
- fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
+ CRIT("%s <%d>:\n\t", __FILE__, __LINE__ ); \
DirectFBErrorFatal( #x, _err ); \
} \
}
if (!ecore_init())
goto shutdown_evas;
- _ecore_evas_log_dom = eina_log_domain_register("Ecore_Evas", ECORE_EVAS_DEFAULT_LOG_COLOR);
+ _ecore_evas_log_dom = eina_log_domain_register("Ecore_Evas", ECORE_DEFAULT_LOG_COLOR);
if(_ecore_evas_log_dom < 0)
{
- EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.\n");
+ EINA_LOG_ERR("Impossible to create a log domain for Ecore_Evas.");
goto shutdown_ecore;
}
ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
eina_log_domain_unregister(_ecore_evas_log_dom);
+ _ecore_evas_log_dom = -1;
ecore_shutdown();
evas_shutdown();
extern int _ecore_evas_log_dom;
-#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
-# undef ECORE_EVAS_DEFAULT_LOG_COLOR
-#endif
-#define ECORE_EVAS_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif
#include "ecore_file_private.h"
-
+int _ecore_file_log_dom = -1;
static int _ecore_file_init_count = 0;
/* externally accessible functions */
{
if (++_ecore_file_init_count != 1)
return _ecore_file_init_count;
-
+ _ecore_file_log_dom = eina_log_domain_register("EcoreFile", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_file_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the ecore file module.");
+ return --_ecore_file_init_count;
+ }
ecore_file_path_init();
ecore_file_monitor_init();
ecore_file_download_init();
ecore_file_download_shutdown();
ecore_file_monitor_shutdown();
ecore_file_path_shutdown();
-
+ eina_log_domain_unregister(_ecore_file_log_dom);
+ _ecore_file_log_dom = -1;
return _ecore_file_init_count;
}
path, mask);
if (ECORE_FILE_MONITOR_INOTIFY(em)->wd < 0)
{
- printf("inotify_add_watch error\n");
+ ERR("inotify_add_watch error");
ecore_file_monitor_inotify_del(em);
return 0;
}
if (mask & IN_MODIFY)
{
- printf("Inotify modified %s: %s\n", type, file);
+ WRN("Inotify modified %s: %s", type, file);
}
if (mask & IN_MOVED_FROM)
{
- printf("Inotify moved from %s: %s\n", type, file);
+ WRN("Inotify moved from %s: %s", type, file);
}
if (mask & IN_MOVED_TO)
{
- printf("Inotify moved to %s: %s\n", type, file);
+ WRN("Inotify moved to %s: %s", type, file);
}
if (mask & IN_DELETE)
{
- printf("Inotify delete %s: %s\n", type, file);
+ WRN("Inotify delete %s: %s", type, file);
}
if (mask & IN_CREATE)
{
- printf("Inotify create %s: %s\n", type, file);
+ WRN("Inotify create %s: %s", type, file);
}
if (mask & IN_DELETE_SELF)
{
- printf("Inotify delete self %s: %s\n", type, file);
+ WRN("Inotify delete self %s: %s", type, file);
}
if (mask & IN_MOVE_SELF)
{
- printf("Inotify move self %s: %s\n", type, file);
+ WRN("Inotify move self %s: %s", type, file);
}
if (mask & IN_UNMOUNT)
{
- printf("Inotify unmount %s: %s\n", type, file);
+ WRN("Inotify unmount %s: %s", type, file);
}
}
#endif
#include "Ecore_File.h"
+extern int _ecore_file_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_file_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_file_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_file_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_file_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_file_log_dom, __VA_ARGS__)
+
/* ecore_file_monitor */
int ecore_file_monitor_init(void);
void ecore_file_monitor_shutdown(void);
EAPI int ECORE_IMF_EVENT_COMMIT = 0;
EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
+int _ecore_imf_log_dom = -1;
static int _ecore_imf_init_count = 0;
/**
if (!ecore_init())
return --_ecore_imf_init_count;
-
+ _ecore_imf_log_dom = eina_log_domain_register("EcoreIMF", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_imf_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore IMF module.");
+ ecore_shutdown();
+ return --_ecore_imf_init_count;
+ }
ecore_imf_module_init();
ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
ecore_shutdown();
ecore_imf_module_shutdown();
-
+ eina_log_domain_unregister(_ecore_imf_log_dom);
+ _ecore_imf_log_dom = -1;
return _ecore_imf_init_count;
}
plugin = ecore_plugin_load(ecore_imf_modules_path, filename, NULL);
if (!plugin)
{
- fprintf(stderr, "** ecore_imf: Error loading input method plugin %s!\n",
- filename);
+ ERR("** Error loading input method plugin %s!",
+ filename);
continue;
}
imf_module_init = ecore_plugin_symbol_get(plugin, "imf_module_init");
if (!imf_module_init || !imf_module_init(&info) || !info)
{
- fprintf(stderr, "** ecore_imf: Error initializing input method plugin %s! "
- "'imf_module_init' is missing or failed to run!",
- filename);
+ ERR("** Error initializing input method plugin %s! "
+ "'imf_module_init' is missing or failed to run!",
+ filename);
ecore_plugin_unload(plugin);
continue;
}
if (_ecore_imf_modules_exists(info->id))
{
- fprintf(stderr, "** ecore_imf: Error loading input method plugin %s! "
- "Plugin with id='%s' already exists!",
- filename, info->id);
+ ERR("** ecore_imf: Error loading input method plugin %s! "
+ "Plugin with id='%s' already exists!",
+ filename, info->id);
ecore_plugin_unload(plugin);
continue;
}
imf_module_create = ecore_plugin_symbol_get(plugin, "imf_module_create");
if (!imf_module_create)
{
- fprintf(stderr, "** ecore_imf: Error setting up input method plugin %s! "
- "'imf_module_create' is missing!",
- filename);
+ ERR("** ecore_imf: Error setting up input method plugin %s! "
+ "'imf_module_create' is missing!",
+ filename);
ecore_plugin_unload(plugin);
continue;
}
#define ECORE_MAGIC_CONTEXT 0x56c1b39a
+extern int _ecore_imf_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_imf_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_imf_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_imf_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_imf_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_imf_log_dom, __VA_ARGS__)
+
typedef struct _Ecore_IMF_Module Ecore_IMF_Module;
struct _Ecore_IMF_Context
#include "Evas.h"
+static int _ecore_input_log_dom = -1;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_input_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_input_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_input_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_input_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_input_log_dom, __VA_ARGS__)
+
typedef struct _Ecore_Input_Window Ecore_Input_Window;
struct _Ecore_Input_Window
{
{
if (++_ecore_event_init_count != 1)
return _ecore_event_init_count;
-
+ _ecore_input_log_dom = eina_log_domain_register("EcoreInput", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_input_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the ecore input module.");
+ return --_ecore_event_init_count;
+ }
ECORE_EVENT_KEY_DOWN = ecore_event_type_new();
ECORE_EVENT_KEY_UP = ecore_event_type_new();
ECORE_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
ECORE_EVENT_MOUSE_WHEEL = 0;
ECORE_EVENT_MOUSE_IN = 0;
ECORE_EVENT_MOUSE_OUT = 0;
-
+ eina_log_domain_unregister(_ecore_input_log_dom);
+ _ecore_input_log_dom = -1;
return ++_ecore_event_init_count;
}
#define DLT_R1 14
#define DLT_R2 15
+int _ecore_ipc_log_dom = -1;
+
/* byte swappers - for dealing with big vs little endian machines */
EAPI unsigned short
_ecore_ipc_swap_16(unsigned short v)
if (++_ecore_ipc_init_count != 1)
return _ecore_ipc_init_count;
-
+ _ecore_ipc_log_dom = eina_log_domain_register("EcoreIpc", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_ipc_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore IPC module.");
+ return --_ecore_ipc_init_count;
+ }
if (!ecore_con_init())
return --_ecore_ipc_init_count;
ecore_event_handler_del(handler[i]);
ecore_con_shutdown();
-
+ eina_log_domain_unregister(_ecore_ipc_log_dom);
+ _ecore_ipc_log_dom = -1;
return _ecore_ipc_init_count;
}
#define _ECORE_IPC_PRIVATE_H
#include "Ecore_Data.h"
+extern int _ecore_ipc_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_ipc_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_ipc_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_ipc_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_ipc_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_ipc_log_dom, __VA_ARGS__)
#if USE_GNUTLS_OPENSSL
# include <gnutls/openssl.h>
#include "ecore_job_private.h"
#include "Ecore_Job.h"
+int _ecore_job_log_dom = -1;
static int _ecore_job_event_handler(void *data, int type, void *ev);
static void _ecore_job_event_free(void *data, void *ev);
{
if (++_ecore_job_init_count != 1)
return _ecore_job_init_count;
-
+ _ecore_job_log_dom = eina_log_domain_register("EcoreJob", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_job_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore Job module.");
+ return _ecore_job_init_count--;
+ }
if (!ecore_init())
return --_ecore_job_init_count;
ecore_event_handler_del(_ecore_job_handler);
_ecore_job_handler = NULL;
+ eina_log_domain_unregister(_ecore_job_log_dom);
+ _ecore_job_log_dom = -1;
ecore_shutdown();
-
+
return _ecore_job_init_count;
}
#define ECORE_MAGIC_JOB 0x76543210
+extern int _ecore_job_log_dom;
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_job_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_job_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_job_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_job_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_job_log_dom, __VA_ARGS__)
+
typedef struct _Ecore_Job Ecore_Job;
struct _Ecore_Job
#include <eina_rbtree.h>
+static int _ecore_sdl_log_dom = -1;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_sdl_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_sdl_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_sdl_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_sdl_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_sdl_log_dom, __VA_ARGS__)
+
typedef struct _Ecore_SDL_Pressed Ecore_SDL_Pressed;
struct _Ecore_SDL_Pressed
{
{
if(++_ecore_sdl_init_count != 1)
return _ecore_sdl_init_count;
-
+ _ecore_sdl_log_dom = eina_log_domain_register("EcoreSdl", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_sdl_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore SDL module.");
+ return --_ecore_sdl_init_count;
+ }
if (!ecore_event_init())
return --_ecore_sdl_init_count;
return _ecore_sdl_init_count;
ecore_event_shutdown();
-
+ eina_log_domain_unregister(_ecore_sdl_log_dom);
+ _ecore_sdl_log_dom = -1;
return _ecore_sdl_init_count;
}
#ifndef _ECORE_TXT_PRIVATE_H
#define _ECORE_TXT_PRIVATE_H
+extern int _ecore_txt_log_dom;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_txt_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_txt_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_txt_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_txt_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_txt_log_dom, __VA_ARGS__)
#endif
ecore_event_shutdown();
eina_log_domain_unregister(_ecore_win32_log_dom_global);
+ _ecore_win32_log_dom_global = -1;
eina_shutdown();
return _ecore_win32_init_count;
ecore_event_shutdown();
eina_log_domain_unregister(_ecore_wince_log_dom_global);
+ _ecore_wince_log_dom_global = -1;
eina_shutdown();
return _ecore_wince_init_count;
static int _ecore_xcb_init_count = 0;
static int _ecore_xcb_grab_count = 0;
+int _ecore_x11xcb_log_dom = -1;
Ecore_X_Connection *_ecore_xcb_conn = NULL;
Ecore_X_Screen *_ecore_xcb_screen = NULL;
if (--_ecore_xcb_init_count != 1)
return _ecore_xcb_init_count;
-
+ _ecore_x11xcb_log_dom = eina_log_domain_register("EcoreXCB", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_x11xcb_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain the Ecore XCB module.");
+ return --_ecore_xcb_init_count;
+ }
_ecore_xcb_conn = xcb_connect(name, &screen);
- if (!_ecore_xcb_conn)
+ if (!_ecore_xcb_conn) {
+ eina_log_domain_unregister(_ecore_x11xcb_log_dom);
+ _ecore_x11xcb_log_dom = -1;
return --_ecore_xcb_init_count;
-
+ }
/* FIXME: no error code right now */
/* _ecore_xcb_error_handler_init(); */
c = (xcb_connection_t *)data;
-/* printf ("nbr events: %d\n", _ecore_xcb_event_handlers_num); */
+/* INF ("nbr events: %d", _ecore_xcb_event_handlers_num); */
/* We check if _ecore_xcb_event_buffered is NULL or not */
if (_ecore_xcb_event_buffered)
target->version = ev->data.data32[1] >> 24;
if (target->version > ECORE_X_DND_VERSION)
{
- printf("DND: Requested version %d, we only support up to %d\n", target->version,
+ WRN("DND: Requested version %d, we only support up to %d", target->version,
ECORE_X_DND_VERSION);
return;
}
&num_ret);
if (!format)
{
- printf("DND: Could not fetch data type list from source window, aborting.\n");
+ ERR("DND: Could not fetch data type list from source window, aborting.");
return;
}
types = (Ecore_X_Atom *)data;
xcb_get_atom_name_name(reply),
reply->name_len);
name[reply->name_len] = '\0';
- printf("Unknown state: %s\n", name);
+ ERR("Unknown state: %s", name);
free(name);
free(reply);
}
xcb_get_atom_name_name(reply),
reply->name_len);
name[reply->name_len] = '\0';
- printf("Unknown state: %s\n", name);
+ WRN("Unknown state: %s", name);
free(name);
}
}
if ((!rep) ||
(((ev->response_type & ~0x80) - rep->first_event) != XCB_RANDR_SCREEN_CHANGE_NOTIFY))
- printf("ERROR: Can't update RandR config!\n");
+ WRN("ERROR: Can't update RandR config!");
if (rep)
free(rep);
}
reply = _ecore_xcb_reply_get();
if (!reply) return NULL;
- printf ("[XCB] reply->bytes_afer (should be 0): %d\n", ((xcb_get_property_reply_t *)reply)->bytes_after);
+ ERR("reply->bytes_afer (should be 0): %d", ((xcb_get_property_reply_t *)reply)->bytes_after);
if (reply->type == ECORE_X_ATOM_UTF8_STRING)
{
if (info)
{
exists = 1;
- printf("Already got info for win: 0x%x\n", window);
+ INF("Already got info for win: 0x%x", window);
_ecore_x_netwm_startup_info_free(info);
}
info = calloc(1, sizeof(Ecore_X_Startup_Info));
}
else
{
- printf("Ecore X Sequence, Unknown: %s=%s\n", key, value);
+ WRN("Ecore X Sequence, Unknown: %s=%s", key, value);
}
}
if (!info->id) return 0;
/* FIXME: this is for simulation only */
#include "Ecore_Txt.h"
+static int _ecore_x11xcb_log_dom -1;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_x11xcb_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_x11xcb_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_x11xcb_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_x11xcb_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_x11xcb_log_dom, __VA_ARGS__)
+
typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
struct _Ecore_X_Selection_Intern
static int _ecore_x_event_shape_id = 0;
static int _ecore_x_event_screensaver_id = 0;
static int _ecore_x_event_sync_id = 0;
+int _ecore_xlib_log_dom = -1;
#ifdef ECORE_XRANDR
static int _ecore_x_event_randr_id = 0;
if (++_ecore_x_init_count != 1)
return _ecore_x_init_count;
-
+ _ecore_xlib_log_dom = eina_log_domain_register("EcoreX11", ECORE_DEFAULT_LOG_COLOR);
+ if(_ecore_xlib_log_dom < 0)
+ {
+ EINA_LOG_ERR("Impossible to create a log domain for the Ecore Xlib module.");
+ return --_ecore_x_init_count;
+ }
if (!ecore_event_init())
- return --_ecore_x_init_count;
-
+ {
+ eina_log_domain_unregister(_ecore_xlib_log_dom);
+ _ecore_xlib_log_dom = -1;
+ return --_ecore_x_init_count;
+ }
_ecore_x_disp = XOpenDisplay((char *)name);
if (!_ecore_x_disp)
goto shutdown_ecore_event;
_ecore_x_dnd_shutdown();
ecore_x_netwm_shutdown();
ecore_event_shutdown();
-
+ eina_log_domain_unregister(_ecore_xlib_log_dom);
+ _ecore_xlib_log_dom = -1;
return _ecore_x_init_count;
}
target->version = (int) (xevent->xclient.data.l[1] >> 24);
if (target->version > ECORE_X_DND_VERSION)
{
- printf("DND: Requested version %d, we only support up to %d\n",
+ WRN("DND: Requested version %d, we only support up to %d",
target->version, ECORE_X_DND_VERSION);
return;
}
XA_ATOM,
32, &data, &num_ret)))
{
- printf("DND: Could not fetch data type list from source window, aborting.\n");
+ WRN("DND: Could not fetch data type list from source window, aborting.");
return;
}
types = (Ecore_X_Atom *)data;
char *name;
name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[1]);
- if (name) printf("Unknown state: %s\n", name);
+ if (name) ERR("Unknown state: %s", name);
XFree(name);
}
e->state[1] = _ecore_x_netwm_state_get(xevent->xclient.data.l[2]);
char *name;
name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[2]);
- if (name) printf("Unknown state: %s\n", name);
+ if (name) ERR("Unknown state: %s", name);
XFree(name);
}
e->source = xevent->xclient.data.l[3];
_ecore_x_last_event_mouse_move = 0;
randr_event = (XRRScreenChangeNotifyEvent *)xevent;
if (!XRRUpdateConfiguration(xevent))
- printf("ERROR: Can't update RR config!\n");
+ ERR("Can't update RR config!");
e = calloc(1, sizeof(Ecore_X_Event_Screen_Change));
if (!e) return;
_ecore_x_event_handle_randr_notify_output_property(randr_event);
break;
default:
- fprintf(stderr, "ERROR: unknown XRandR RRNotify subtype: %d.\n",
- randr_event->subtype);
+ ERR("Unknown XRandR RRNotify subtype: %d.",
+ randr_event->subtype);
break;
}
}
if (info)
{
exists = 1;
- printf("Already got info for win: 0x%x\n", win);
+ WRN("Already got info for win: 0x%x", win);
_ecore_x_netwm_startup_info_free(info);
}
info = calloc(1, sizeof(Ecore_X_Startup_Info));
}
else
{
- printf("Ecore X Sequence, Unknown: %s=%s\n", key, value);
+ ERR("Ecore X Sequence, Unknown: %s=%s", key, value);
}
}
if (!info->id) return 0;
/* FIXME: this is for simulation only */
#include "Ecore_Txt.h"
+extern int _ecore_xlib_log_dom;
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_ecore_xlib_log_dom, __VA_ARGS__)
+
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_ecore_xlib_log_dom, __VA_ARGS__)
+
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_ecore_xlib_log_dom, __VA_ARGS__)
+
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_ecore_xlib_log_dom, __VA_ARGS__)
+
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_xlib_log_dom, __VA_ARGS__)
+
typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
struct _Ecore_X_Selection_Intern
sc = XRRGetScreenInfo(_ecore_x_disp, root);
if (!sc)
{
- printf("ERROR: Couldn't get screen information for %d\n", root);
+ ERR("Couldn't get screen information for %d", root);
return ret;
}
size_index = XRRConfigCurrentConfiguration(sc, &rotation);
root, size_index,
RR_Rotate_0, CurrentTime))
{
- printf("ERROR: Can't set new screen size!\n");
+ ERR("Can't set new screen size!");
XRRFreeScreenConfigInfo(sc);
return 0;
}
sc = XRRGetScreenInfo(_ecore_x_disp, root);
if (!sc)
{
- printf("ERROR: Couldn't get screen information for %d\n", root);
+ ERR("Couldn't get screen information for %d", root);
return ret;
}
ret.rate = XRRConfigCurrentRate(sc);
sc = XRRGetScreenInfo(_ecore_x_disp, root);
if (!sc)
{
- printf("ERROR: Couldn't get screen information for %d\n", root);
+ ERR("Couldn't get screen information for %d", root);
return ret;
}
root, size_index,
RR_Rotate_0, rate.rate, CurrentTime))
{
- printf("ERROR: Can't set new screen size and refresh rate!\n");
+ ERR("Can't set new screen size and refresh rate!");
XRRFreeScreenConfigInfo(sc);
return 0;
}