[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-devel
Subject:    [E-devel] [PATCH] patch for edje (eina_log related)
From:       Mathieu Taillefumier <mathieu.taillefumier () free ! fr>
Date:       2009-11-24 21:34:32
Message-ID: 4B0C5168.7020700 () free ! fr
[Download RAW message or body]

Hello,

I send the patch for edje that implement all log messages through 
eina_log. I use eina_log everywhere except for the messages in edje_cc 
(althrough there is a domain that is initialized for the internal 
functions). Actually I am not completely convinced that it is useful to 
use eina_log for the messages send by edje_cc (and edje_decc) since they 
are warning or errors that are related to the script the programs are 
working on. So to ease thing a bit I prepared two patchs one for the 
library and one the programs.

best

Mathieu

["edje-bin.patch" (text/plain)]

Index: edje_cc_sources.c
===================================================================
--- edje_cc_sources.c	(revision 43803)
+++ edje_cc_sources.c	(working copy)
@@ -59,8 +59,8 @@
    f = fopen(fil, "rb");
    if (!f)
      {
-	fprintf(stderr, "%s: Warning. Cannot open file '%s'\n",
-	      progname, fil);
+	ERR("%s: Warning. Cannot open file '%s'",
+	    progname, fil);
 	exit(-1);
      }
 
@@ -75,7 +75,7 @@
 	tmp = fread(sf->file, sz, 1, f);
 	if (tmp != 1)
 	  {
-	     fprintf(stderr, "%s: Warning file length for (%s) doesn't match !\n",
+	     ERR("%s: Warning file length for (%s) doesn't match !",
 		     progname, filname);
 	     exit(-1);
 	  }
Index: edje_cc.h
===================================================================
--- edje_cc.h	(revision 43803)
+++ edje_cc.h	(working copy)
@@ -12,6 +12,23 @@
 # define O_BINARY 0
 #endif
 
+/* logging variables */
+extern int _edje_cc_log_dom ;
+#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(fmt, ...) EINA_LOG_DOM_ERR(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef INF
+# undef INF
+#endif
+#define INF(fmt, ...) EINA_LOG_DOM_INFO(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(fmt, ...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
+
+
 /* types */
 typedef struct _New_Object_Handler    New_Object_Handler;
 typedef struct _New_Statement_Handler New_Statement_Handler;
Index: edje_cc_out.c
===================================================================
--- edje_cc_out.c	(revision 43803)
+++ edje_cc_out.c	(working copy)
@@ -125,7 +125,7 @@
 {
    va_list ap;
 
-   fprintf(stderr, "%s: Error. ", progname);
+   ERR("%s: Error. ", progname);
 
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
@@ -270,7 +270,7 @@
 
    if (verbose)
      {
-	printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
+	ERR("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header",
 	       progname, bytes, (bytes + 512) / 1024);
      }
 
@@ -362,7 +362,7 @@
 
 	     if (verbose)
 	       {
-		  printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: \
[real: %2.1f%%]\n", +		  ERR("%s: Wrote %9i bytes (%4iKb) for \"%s\" font entry \
\"%s\" compress: [real: %2.1f%%]",  progname, bytes, (bytes + 512) / 1024, buf, \
fn->file,  100 - (100 * (double)bytes) / ((double)(fsize))
 			 );
@@ -529,7 +529,7 @@
 			      st.st_size = 0;
 			    *input_bytes += st.st_size;
 			    *input_raw_bytes += im_w * im_h * 4;
-			    printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: \
[raw: %2.1f%%] [real: %2.1f%%]\n", +			    INF("%s: Wrote %9i bytes (%4iKb) for \
\"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]",  progname, \
bytes, (bytes + 512) / 1024, buf, img->entry,  100 - (100 * (double)bytes) / \
((double)(im_w * im_h * 4)),  100 - (100 * (double)bytes) / ((double)(st.st_size))
@@ -624,8 +624,8 @@
 
 	if (verbose)
 	  {
-	     printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" collection entry\n",
-		    progname, bytes, (bytes + 512) / 1024, buf);
+	     INF("%s: Wrote %9i bytes (%4iKb) for \"%s\" collection entry",
+		 progname, bytes, (bytes + 512) / 1024, buf);
 	  }
      }
 
@@ -971,8 +971,8 @@
    ef = eet_open(file_out, EET_FILE_MODE_WRITE);
    if (!ef)
      {
-	fprintf(stderr, "%s: Error. Unable to open \"%s\" for writing output\n",
-		progname, file_out);
+	ERR("%s: Error. Unable to open \"%s\" for writing output",
+	    progname, file_out);
 	exit(-1);
      }
 
@@ -1006,35 +1006,35 @@
 	input_bytes += st.st_size;
 	input_raw_bytes += st.st_size;
 	printf("Summary:\n"
-	       "  Wrote %i collections\n"
-	       "  Wrote %i images\n"
-	       "  Wrote %i fonts\n"
-	       "  Wrote %i bytes (%iKb) of original source data\n"
-	       "  Wrote %i bytes (%iKb) of original source font map\n"
-	       "Conservative compression summary:\n"
-	       "  Wrote total %i bytes (%iKb) from %i (%iKb) input data\n"
-	       "  Output file is %3.1f%% the size of the input data\n"
-	       "  Saved %i bytes (%iKb)\n"
-	       "Raw compression summary:\n"
-	       "  Wrote total %i bytes (%iKb) from %i (%iKb) raw input data\n"
-	       "  Output file is %3.1f%% the size of the raw input data\n"
-	       "  Saved %i bytes (%iKb)\n"
-	       ,
-	       collection_num,
-	       image_num,
-	       font_num,
-	       src_bytes, (src_bytes + 512) / 1024,
-	       fmap_bytes, (fmap_bytes + 512) / 1024,
-	       total_bytes, (total_bytes + 512) / 1024,
-	       input_bytes, (input_bytes + 512) / 1024,
-	       (100.0 * (double)total_bytes) / (double)input_bytes,
-	       input_bytes - total_bytes,
-	       (input_bytes - total_bytes + 512) / 1024,
-	       total_bytes, (total_bytes + 512) / 1024,
-	       input_raw_bytes, (input_raw_bytes + 512) / 1024,
-	       (100.0 * (double)total_bytes) / (double)input_raw_bytes,
-	       input_raw_bytes - total_bytes,
-	       (input_raw_bytes - total_bytes + 512) / 1024);
+	    "  Wrote %i collections\n"
+	    "  Wrote %i images\n"
+	    "  Wrote %i fonts\n"
+	    "  Wrote %i bytes (%iKb) of original source data\n"
+	    "  Wrote %i bytes (%iKb) of original source font map\n"
+	    "Conservative compression summary:\n"
+	    "  Wrote total %i bytes (%iKb) from %i (%iKb) input data\n"
+	    "  Output file is %3.1f%% the size of the input data\n"
+	    "  Saved %i bytes (%iKb)\n"
+	    "Raw compression summary:\n"
+	    "  Wrote total %i bytes (%iKb) from %i (%iKb) raw input data\n"
+	    "  Output file is %3.1f%% the size of the raw input data\n"
+	    "  Saved %i bytes (%iKb)"
+	    ,
+	    collection_num,
+	    image_num,
+	    font_num,
+	    src_bytes, (src_bytes + 512) / 1024,
+	    fmap_bytes, (fmap_bytes + 512) / 1024,
+	    total_bytes, (total_bytes + 512) / 1024,
+	    input_bytes, (input_bytes + 512) / 1024,
+	    (100.0 * (double)total_bytes) / (double)input_bytes,
+	    input_bytes - total_bytes,
+	    (input_bytes - total_bytes + 512) / 1024,
+	    total_bytes, (total_bytes + 512) / 1024,
+	    input_raw_bytes, (input_raw_bytes + 512) / 1024,
+	    (100.0 * (double)total_bytes) / (double)input_raw_bytes,
+	    input_raw_bytes - total_bytes,
+	    (input_raw_bytes - total_bytes + 512) / 1024);
      }
 }
 
@@ -1161,8 +1161,8 @@
 	  }
 	if (!l)
 	  {
-	     fprintf(stderr, "%s: Error. Unable to find part name \"%s\".\n",
-		     progname, pl->name);
+	     ERR("%s: Error. Unable to find part name \"%s\".",
+		 progname, pl->name);
 	     exit(-1);
 	  }
 	part_lookups = eina_list_remove(part_lookups, pl);
@@ -1187,8 +1187,8 @@
 	  }
 	if (!l)
 	  {
-	     fprintf(stderr, "%s: Error. Unable to find program name \"%s\".\n",
-		     progname, pl->name);
+	     ERR("%s: Error. Unable to find program name \"%s\".",
+		 progname, pl->name);
 	     exit(-1);
 	  }
 	program_lookups = eina_list_remove(program_lookups, pl);
@@ -1212,8 +1212,8 @@
           }
         if (!l)
           {
-             fprintf(stderr, "%s: Error. Unable to find group name \"%s\".\n",
-                     progname, gl->name);
+             ERR("%s: Error. Unable to find group name \"%s\".",
+		 progname, gl->name);
              exit(-1);
           }
         group_lookups = eina_list_remove(group_lookups, gl);
@@ -1248,8 +1248,8 @@
 
 	if (!l)
 	  {
-	     fprintf(stderr, "%s: Error. Unable to find image name \"%s\".\n",
-		     progname, il->name);
+	     ERR("%s: Error. Unable to find image name \"%s\".",
+		 progname, il->name);
 	     exit(-1);
 	  }
 	image_lookups = eina_list_remove(image_lookups, il);
@@ -1282,8 +1282,8 @@
 
 	if (!l)
 	  {
-	     fprintf(stderr, "%s: Error. unable to find spectrum name %s\n",
-		     progname, il->name);
+	     ERR("%s: Error. unable to find spectrum name %s",
+		 progname, il->name);
 	     exit(-1);
 	  }
 	spectrum_lookups = eina_list_remove(spectrum_lookups, il);
@@ -1517,8 +1517,8 @@
 	n = eina_convert_itoa(cl->val, buf);
 	if (n > cl->len)
 	  {
-	     fprintf(stderr, "%s: Error. The unexpected happened. A numeric replacement \
                string was larger than the original!\n",
-		     progname);
+	     ERR("%s: Error. The unexpected happened. A numeric replacement string was \
larger than the original!", +		 progname);
 	     exit(-1);
 	  }
 	memset(cl->ptr, ' ', cl->len);
Index: edje_prefix.c
===================================================================
--- edje_prefix.c	(revision 43803)
+++ edje_prefix.c	(working copy)
@@ -26,7 +26,7 @@
 #endif
 
 #include "edje_prefix.h"
-
+#include "edje_cc.h"
 #ifdef _WIN32
 # define EDJE_DIR_SEPARATOR '\\'
 # define EDJE_DIR_SEPARATOR_S "\\"
@@ -301,7 +301,7 @@
    _prefix_path_bin    = strdup(PACKAGE_BIN_DIR);
    _prefix_path_data   = strdup(PACKAGE_DATA_DIR);
    _prefix_path_lib    = strdup(PACKAGE_LIB_DIR);
-   printf("WARNING: Edje could not determine its installed prefix\n"
+   WRN("WARNING: Edje could not determine its installed prefix\n"
 	  "         and is falling back on the compiled in default:\n"
 	  "           %s\n"
 	  "         You might like to try setting the following environment variables:\n"
@@ -311,9 +311,8 @@
 	  "           EDJE_LIB_DIR - optional in addition to E_PREFIX to provide\n"
 	  "                          a more specific library dir\n"
 	  "           EDJE_DATA_DIR- optional in addition to E_PREFIX to provide\n"
-	  "                          a more specific location for shared data\n"
-	  ,
-	  _prefix_path);
+	  "                          a more specific location for shared data",
+       _prefix_path);
    return 1;
 }
 
Index: edje_decc.c
===================================================================
--- edje_decc.c	(revision 43803)
+++ edje_decc.c	(working copy)
@@ -21,6 +21,7 @@
 
 #include "edje_decc.h"
 
+int _edje_cc_log_dom = -1;
 char *progname = NULL;
 char *file_in = NULL;
 char *file_out = NULL;
@@ -55,7 +56,15 @@
    int i;
 
    setlocale(LC_NUMERIC, "C");
-
+   eina_init();
+   _edje_cc_log_dom = eina_log_domain_register("edje_decc", \
EDJE_CC_DEFAULT_LOG_COLOR); +   if(_edje_cc_log_dom < 0)
+     {
+       EINA_LOG_ERR("Edje_decc: Impossible to create a log domain for edje_decc");
+       eina_shutdown();
+       exit(-1);
+     }
+   eina_log_level_set(EINA_LOG_LEVEL_INFO);
    progname = argv[0];
    for (i = 1; i < argc; i++)
      {
@@ -69,7 +78,7 @@
      }
    if (!file_in)
      {
-	fprintf(stderr, "%s: Error: no input file specified.\n", progname);
+	ERR("%s: Error: no input file specified.", progname);
 	main_help();
 	exit(-1);
      }
@@ -83,6 +92,9 @@
 
    eet_close(ef);
    eet_shutdown();
+   eina_log_domain_unregister(_edje_cc_log_dom);
+   _edje_cc_log_dom = -1;
+   eina_shutdown();
    return 0;
 }
 
@@ -92,27 +104,27 @@
    ef = eet_open(file_in, EET_FILE_MODE_READ);
    if (!ef)
      {
-	printf("ERROR: cannot open %s\n", file_in);
+	ERR("ERROR: cannot open %s", file_in);
 	return 0;
      }
 
    srcfiles = source_load(ef);
    if (!srcfiles || !srcfiles->list)
      {
-	printf("ERROR: %s has no decompile information\n", file_in);
+	ERR("ERROR: %s has no decompile information", file_in);
 	eet_close(ef);
 	return 0;
      }
    if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
      {
-        printf("ERROR: Invalid root filename: '%s'\n", (char *) \
eina_list_data_get(srcfiles->list)); +        ERR("ERROR: Invalid root filename: \
'%s'", (char *) eina_list_data_get(srcfiles->list));  eet_close(ef);
 	return 0;
      }
    edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje_file");
    if (!edje_file)
      {
-	printf("ERROR: %s does not appear to be an edje file\n", file_in);
+        ERR("ERROR: %s does not appear to be an edje file", file_in);
 	eet_close(ef);
 	return 0;
      }
@@ -122,7 +134,7 @@
      }
    else if (!compiler_cmd_is_sane())
      {
-	printf("ERROR: invalid compiler executable: '%s'\n", edje_file->compiler);
+	ERR("ERROR: invalid compiler executable: '%s'", edje_file->compiler);
 	eet_close(ef);
 	return 0;
      }
@@ -173,14 +185,14 @@
 		  ee = ecore_evas_buffer_new(1, 1);
 		  if (!ee)
 		    {
-		       fprintf(stderr, "Error. cannot create buffer engine canvas for image \
save.\n"); +		       ERR("Cannot create buffer engine canvas for image save.");
 		       exit(-1);
 		    }
 		  evas = ecore_evas_get(ee);
 		  im = evas_object_image_add(evas);
 		  if (!im)
 		    {
-		       fprintf(stderr, "Error. cannot create image object for save.\n");
+		       ERR("Cannot create image object for save.");
 		       exit(-1);
 		    }
 		  snprintf(buf, sizeof(buf), "images/%i", ei->id);
@@ -192,14 +204,14 @@
 		  *p = 0;
 		  if (strstr(pp, "../"))
 		    {
-		       printf("ERROR: potential security violation. attempt to write in parent \
dir.\n"); +		       ERR("Potential security violation. attempt to write in parent \
dir.");  exit(-1);
 		    }
 		  ecore_file_mkpath(pp);
 		  free(pp);
 		  if (!evas_object_image_save(im, out, NULL, "quality=100 compress=9"))
 		    {
-		       printf("ERROR: cannot write file %s. Perhaps missing JPEG or PNG saver \
modules for Evas.\n", out); +		       ERR("Cannot write file %s. Perhaps missing JPEG \
or PNG saver modules for Evas.", out);  exit(-1);
 		    }
 		  evas_object_del(im);
@@ -217,26 +229,26 @@
 	char *pp;
 
 	snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
-	printf("Output Source File: %s\n", out);
+	INF("Output Source File: %s\n", out);
 	pp = strdup(out);
 	p = strrchr(pp, '/');
 	*p = 0;
 	if (strstr(pp, "../"))
 	  {
-	     printf("ERROR: potential security violation. attempt to write in parent \
dir.\n"); +	     ERR("Potential security violation. attempt to write in parent \
dir.");  exit (-1);
 	  }
 	ecore_file_mkpath(pp);
 	free(pp);
 	if (strstr(out, "../"))
 	  {
-	     printf("ERROR: potential security violation. attempt to write in parent \
dir.\n"); +	     ERR("Potential security violation. attempt to write in parent \
dir.");  exit (-1);
 	  }
 	f = fopen(out, "wb");
 	if (!f)
 	  {
-	     printf("ERROR: unable to write file (%s).\n", out);
+	     ERR("Unable to write file (%s).", out);
 	     exit (-1);
 	  }
 
@@ -264,20 +276,20 @@
 		  char *pp;
 
 		  snprintf(out, sizeof(out), "%s/%s", outdir, fn->file);
-		  printf("Output Font: %s\n", out);
+		  INF("Output Font: %s", out);
 		  pp = strdup(out);
 		  p = strrchr(pp, '/');
 		  *p = 0;
 		  if (strstr(pp, "../"))
 		    {
-		       printf("ERROR: potential security violation. attempt to write in parent \
dir.\n"); +		       ERR("Potential security violation. attempt to write in parent \
dir.");  exit (-1);
 		    }
 		  ecore_file_mkpath(pp);
 		  free(pp);
 		  if (strstr(out, "../"))
 		    {
-		       printf("ERROR: potential security violation. attempt to write in parent \
dir.\n"); +		       ERR("Potential security violation. attempt to write in parent \
dir.");  exit (-1);
 		    }
 		  f = fopen(out, "wb");
@@ -296,7 +308,7 @@
 	printf("Output Build Script: %s\n", out);
 	if (strstr(out, "../"))
 	  {
-	     printf("ERROR: potential security violation. attempt to write in parent \
dir.\n"); +	     ERR("Potential security violation. attempt to write in parent \
dir.");  exit (-1);
 	  }
 	f = fopen(out, "wb");
@@ -312,9 +324,9 @@
 
 	chmod(out, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP);
 
-	printf("\n*** CAUTION ***\n"
-	      "Please check the build script for anything malicious "
-	      "before running it!\n\n");
+	WRN("\n*** CAUTION ***\n"
+	    "Please check the build script for anything malicious "
+	    "before running it!");
      }
    eet_close(ef);
 }
Index: edje_cc_parse.c
===================================================================
--- edje_cc_parse.c	(revision 43803)
+++ edje_cc_parse.c	(working copy)
@@ -111,9 +111,9 @@
      }
    if (!handled)
      {
-	fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
-		progname, file_in, line - 1,
-		(char *)eina_list_data_get(eina_list_last(stack)));
+	ERR("%s: Error. %s:%i unhandled keyword %s",
+	    progname, file_in, line - 1,
+	    (char *)eina_list_data_get(eina_list_last(stack)));
 	exit(-1);
      }
    free(id);
@@ -141,9 +141,9 @@
      }
    if (!handled)
      {
-	fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
-		progname, file_in, line - 1,
-		(char *)eina_list_data_get(eina_list_last(stack)));
+	ERR("%s: Error. %s:%i unhandled keyword %s",
+	    progname, file_in, line - 1,
+	    (char *)eina_list_data_get(eina_list_last(stack)));
 	exit(-1);
      }
    free(id);
@@ -244,8 +244,8 @@
 	     tmpstr = alloca(l + 1);
 	     if (!tmpstr)
 	       {
-		  fprintf(stderr, "%s: Error. %s:%i malloc %i bytes failed\n",
-			  progname, file_in, line - 1, l + 1);
+		  ERR("%s: Error. %s:%i malloc %i bytes failed",
+		      progname, file_in, line - 1, l + 1);
 		  exit(-1);
 	       }
 	     strncpy(tmpstr, p, l);
@@ -421,8 +421,8 @@
      }
    else
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. } marker without matching { \
                marker\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. } marker without matching { marker",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 }
@@ -436,7 +436,7 @@
 
    if (verbose)
      {
-	printf("%s: Parsing input file\n",
+	INF("%s: Parsing input file",
 	       progname);
      }
    p = data;
@@ -449,8 +449,8 @@
 	 */
 	if (do_params && delim && *token != ';')
 	  {
-	     fprintf(stderr, "%s: Error. parse error %s:%i. %c marker before ; marker\n",
-		   progname, file_in, line - 1, *token);
+	     ERR("%s: Error. parse error %s:%i. %c marker before ; marker",
+		 progname, file_in, line - 1, *token);
 	     exit(-1);
 	  }
 	else if (delim)
@@ -460,7 +460,7 @@
 	       {
 		  if (do_params)
 		    {
-		       fprintf(stderr, "%s: Error. parse error %s:%i. } marker before ; marker\n",
+		       ERR("%s: Error. parse error %s:%i. } marker before ; marker",
 			       progname, file_in, line - 1);
 		       exit(-1);
 		    }
@@ -487,8 +487,8 @@
 	       {
 		  if (do_params)
 		    {
-		       fprintf(stderr, "%s: Error. parse error %s:%i. { marker before ; marker\n",
-			       progname, file_in, line - 1);
+		       ERR("%s: Error. parse error %s:%i. { marker before ; marker",
+			   progname, file_in, line - 1);
 		       exit(-1);
 		    }
 	       }
@@ -570,8 +570,8 @@
 			 }
 		       else
 			 {
-			    fprintf(stderr, "%s: Error. parse error %s:%i. { marker does not have \
                matching } marker\n",
-				    progname, file_in, line - 1);
+			    ERR("%s: Error. parse error %s:%i. { marker does not have matching } marker",
+				progname, file_in, line - 1);
 			    exit(-1);
 			 }
 		       new_object();
@@ -582,7 +582,7 @@
      }
    if (verbose)
      {
-	printf("%s: Parsing done\n",
+	INF("%s: Parsing done",
 	       progname);
      }
 }
@@ -725,13 +725,13 @@
    fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
    if (fd < 0)
      {
-	fprintf(stderr, "%s: Error. cannot open file \"%s\" for input. %s\n",
-		progname, file_in, strerror(errno));
+	ERR("%s: Error. cannot open file \"%s\" for input. %s",
+	    progname, file_in, strerror(errno));
 	exit(-1);
      }
    if (verbose)
      {
-	printf("%s: Opening \"%s\" for input\n",
+	INF("%s: Opening \"%s\" for input",
 	       progname, file_in);
      }
 
@@ -742,8 +742,8 @@
 	parse(data, size);
    else
      {
-	fprintf(stderr, "%s: Error. cannot read file \"%s\". %s\n",
-		progname, file_in, strerror(errno));
+	ERR("%s: Error. cannot read file \"%s\". %s",
+	    progname, file_in, strerror(errno));
 	exit(-1);
      }
    free(data);
@@ -770,7 +770,7 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
 		progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
@@ -790,8 +790,8 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
-		progname, file_in, line - 1, n + 1);
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
+	    progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
    s = mem_strdup(str);
@@ -814,8 +814,8 @@
 	/* End of the list, nothing matched. */
 	if (!s)
 	  {
-	     fprintf(stderr, "%s: Error. %s:%i token %s not one of:",
-		     progname, file_in, line - 1, str);
+ 	     fprintf(stderr, "%s: Error. %s:%i token %s not one of:",
+	 	     progname, file_in, line - 1, str);
 	     s = va_arg(va2, char *);
 	     while (s)
 	       {
@@ -853,7 +853,7 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
 		progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
@@ -890,8 +890,8 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
-		progname, file_in, line - 1, n + 1);
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
+	    progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
    i = my_atoi(str);
@@ -907,15 +907,15 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
-		progname, file_in, line - 1, n + 1);
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
+	    progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
    i = my_atoi(str);
    if ((i < f) || (i > t))
      {
-	fprintf(stderr, "%s: Error. %s:%i integer %i out of range of %i to %i inclusive\n",
-		progname, file_in, line - 1, i, f, t);
+	ERR("%s: Error. %s:%i integer %i out of range of %i to %i inclusive",
+	    progname, file_in, line - 1, i, f, t);
 	exit(-1);
      }
    return i;
@@ -930,15 +930,15 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
-		progname, file_in, line - 1, n + 1);
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
+	    progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
 
    if (!strstrip(str, buf, sizeof (buf)))
      {
-	fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. %s:%i expression is too long",
+	    progname, file_in, line - 1);
 	return 0;
      }
 
@@ -950,8 +950,8 @@
    i = my_atoi(str);
    if ((i < 0) || (i > 1))
      {
-	fprintf(stderr, "%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive\n",
-		progname, file_in, line - 1, i);
+	ERR("%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive",
+	    progname, file_in, line - 1, i);
 	exit(-1);
      }
    return i;
@@ -966,8 +966,8 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
-		progname, file_in, line - 1, n + 1);
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
+	    progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
    i = my_atof(str);
@@ -983,15 +983,15 @@
    str = eina_list_nth(params, n);
    if (!str)
      {
-	fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
-		progname, file_in, line - 1, n + 1);
+	ERR("%s: Error. %s:%i no parameter supplied as argument %i",
+	    progname, file_in, line - 1, n + 1);
 	exit(-1);
      }
    i = my_atof(str);
    if ((i < f) || (i > t))
      {
-	fprintf(stderr, "%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f \
                inclusive\n",
-		progname, file_in, line - 1, i, f, t);
+	ERR("%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f inclusive",
+	    progname, file_in, line - 1, i, f, t);
 	exit(-1);
      }
    return i;
@@ -1004,8 +1004,8 @@
 
    if (num_args != required_args)
      {
-	fprintf(stderr, "%s: Error. %s:%i got %i arguments, but expected %i\n",
-	      progname, file_in, line - 1, num_args, required_args);
+       ERR("%s: Error. %s:%i got %i arguments, but expected %i",
+	   progname, file_in, line - 1, num_args, required_args);
 	exit(-1);
      }
 }
@@ -1017,9 +1017,9 @@
 
    if (num_args < min_required_args)
      {
-	fprintf(stderr, "%s: Error. %s:%i got %i arguments, "
-		"but expected at least %i\n",
-		progname, file_in, line - 1, num_args, min_required_args);
+	ERR("%s: Error. %s:%i got %i arguments, "
+		"but expected at least %i",
+	    progname, file_in, line - 1, num_args, min_required_args);
 	exit(-1);
      }
 }
@@ -1047,8 +1047,8 @@
 
    if (!strstrip(s, buf, sizeof (buf)))
      {
-	fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. %s:%i expression is too long",
+	    progname, file_in, line - 1);
 	return 0;
      }
 
@@ -1063,8 +1063,8 @@
 
    if ('(' != s[0])
      {
-	fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
-		progname, file_in, line - 1, s);
+	ERR("%s: Error. %s:%i unexpected character at %s",
+	    progname, file_in, line - 1, s);
 	return s;
      }
    else
@@ -1094,8 +1094,8 @@
 	return s;
      }
    else
-     fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
-	     progname, file_in, line - 1, s);
+     ERR("%s: Error. %s:%i unexpected character at %s",
+	 progname, file_in, line - 1, s);
    return s;
 }
 
@@ -1217,15 +1217,15 @@
 	if(0 != b)
 	  a /= b;
 	else
-	  fprintf(stderr, "%s: Error. %s:%i divide by zero\n",
-		  progname, file_in, line - 1);
+	  ERR("%s: Error. %s:%i divide by zero",
+	      progname, file_in, line - 1);
 	return a;
       case '*':
 	a *= b;
 	return a;
       default:
-	fprintf(stderr, "%s: Error. %s:%i unexpected character '%c'\n",
-		progname, file_in, line - 1, op);
+	ERR("%s: Error. %s:%i unexpected character '%c'",
+	    progname, file_in, line - 1, op);
 	return a;
      }
 }
@@ -1243,7 +1243,7 @@
 
    if (!strstrip(s, buf, sizeof (buf)))
      {
-	fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
+	ERR("%s: Error. %s:%i expression is too long",
 		progname, file_in, line - 1);
 	return 0;
      }
@@ -1259,8 +1259,8 @@
 
    if ('(' != s[0])
      {
-	fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
-		progname, file_in, line - 1, s);
+	ERR("%s: Error. %s:%i unexpected character at %s",
+	    progname, file_in, line - 1, s);
 	return s;
      }
    else
@@ -1290,8 +1290,8 @@
 	return s;
      }
    else
-     fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
-	     progname, file_in, line - 1, s);
+     ERR("%s: Error. %s:%i unexpected character at %s",
+	 progname, file_in, line - 1, s);
    return s;
 }
 
@@ -1417,15 +1417,15 @@
       case '/':
 	if (b != 0) a /= b;
 	else
-	  fprintf(stderr, "%s: Error. %s:%i divide by zero\n",
-		  progname, file_in, line - 1);
+	  ERR("%s: Error. %s:%i divide by zero",
+	      progname, file_in, line - 1);
 	return a;
       case '*':
 	a *= b;
 	return a;
       default:
-	fprintf(stderr, "%s: Error. %s:%i unexpected character '%c'\n",
-		progname, file_in, line - 1, op);
+	ERR("%s: Error. %s:%i unexpected character '%c'",
+	    progname, file_in, line - 1, op);
 	return a;
      }
 }
@@ -1435,8 +1435,8 @@
 {
    if ((size -1 ) < strlen(in))
      {
-	fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. %s:%i expression is too long",
+	    progname, file_in, line - 1);
 	return 0;
      }
 
Index: edje_cc_mem.c
===================================================================
--- edje_cc_mem.c	(revision 43803)
+++ edje_cc_mem.c	(working copy)
@@ -18,8 +18,8 @@
 
    mem = calloc(1, size);
    if (mem) return mem;
-   fprintf(stderr, "%s: Error. %s:%i memory allocation of %i bytes failed. %s\n",
-	   progname, file_in, line, size, strerror(errno));
+   ERR("%s: Error. %s:%i memory allocation of %i bytes failed. %s",
+       progname, file_in, line, size, strerror(errno));
    exit(-1);
    return NULL;
 }
@@ -31,8 +31,8 @@
 
    str = strdup(s);
    if (str) return str;
-   fprintf(stderr, "%s: Error. %s:%i memory allocation of %i bytes failed. %s. \
                string being duplicated: \"%s\"\n",
-	   progname, file_in, line, strlen(s) + 1, strerror(errno), s);
+   ERR("%s: Error. %s:%i memory allocation of %i bytes failed. %s. string being \
duplicated: \"%s\"", +       progname, file_in, line, strlen(s) + 1, strerror(errno), \
s);  exit(-1);
    return NULL;
 }
Index: edje_decc.h
===================================================================
--- edje_decc.h	(revision 43803)
+++ edje_decc.h	(working copy)
@@ -3,6 +3,22 @@
 
 #include <edje_private.h>
 
+/* logging variables */
+extern int _edje_cc_log_dom ;
+#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
+
 /* types */
 typedef struct _Font                  Font;
 typedef struct _Font_List             Font_List;
Index: edje_cc.c
===================================================================
--- edje_cc.c	(revision 43803)
+++ edje_cc.c	(working copy)
@@ -13,7 +13,7 @@
 
 #include "edje_cc.h"
 #include "edje_prefix.h"
-
+int _edje_cc_log_dom = -1;
 static void main_help(void);
 
 Eina_List *img_dirs = NULL;
@@ -63,10 +63,15 @@
    setlocale(LC_NUMERIC, "C");
 
    eina_init();
-
+   _edje_cc_log_dom = eina_log_domain_register("EDJE_CC", EDJE_DEFAULT_LOG_COLOR);
+   if(_edje_cc_log_dom<0)
+     {
+       EINA_LOG_ERR("Enable to create a log domain.");
+       exit(1);
+     }
    tmp_dir = getenv("TMPDIR");
 
-
+   
    progname = argv[0];
    for (i = 1; i < argc; i++)
      {
@@ -210,7 +215,7 @@
    data_write();
 
    edje_shutdown();
-
+   eina_log_domain_unregister(_edje_cc_log_dom);
    eina_shutdown();
 
    return 0;
Index: edje_cc_handlers.c
===================================================================
--- edje_cc_handlers.c	(revision 43803)
+++ edje_cc_handlers.c	(working copy)
@@ -862,23 +862,23 @@
    fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
    if (fd < 0)
      {
-        fprintf(stderr, "%s: Error. %s:%i when opening file \"%s\": \"%s\"\n",
-                progname, file_in, line, filename, strerror(errno));
+        ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"",
+	    progname, file_in, line, filename, strerror(errno));
         exit(-1);
      }
 
    if (fstat(fd, &buf))
      {
-        fprintf(stderr, "%s: Error. %s:%i when stating file \"%s\": \"%s\"\n",
-                progname, file_in, line, filename, strerror(errno));
+        ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"",
+	    progname, file_in, line, filename, strerror(errno));
         exit(-1);
      }
 
    data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
    if (data == MAP_FAILED)
      {
-        fprintf(stderr, "%s: Error. %s:%i when mapping file \"%s\": \"%s\"\n",
-                progname, file_in, line, filename, strerror(errno));
+        ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"",
+	    progname, file_in, line, filename, strerror(errno));
         exit(-1);
      }
 
@@ -886,7 +886,7 @@
    for (i = 0; i < buf.st_size; ++i, ++over)
      if (*over == '\0')
        {
-          fprintf(stderr, "%s: Error. %s:%i file \"%s\" is a binary file.\n",
+          ERR("%s: Error. %s:%i file \"%s\" is a binary file.",
                   progname, file_in, line, filename);
           exit(-1);
        }
@@ -1185,8 +1185,8 @@
      {
 	if ((stl != tstl) && (!strcmp(stl->name, tstl->name)))
 	  {
-	     fprintf(stderr, "%s: Error. parse error %s:%i. There is already a style named \
                \"%s\"\n",
-		     progname, file_in, line - 1, stl->name);
+	     ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"",
+		 progname, file_in, line - 1, stl->name);
 	     exit(-1);
 	  }
      }
@@ -1212,8 +1212,8 @@
    stl = eina_list_data_get(eina_list_last(edje_file->styles));
    if (stl->tags)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. There is already a basic format for \
                the style\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. There is already a basic format for the style",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
    tag = mem_alloc(SZ(Edje_Style_Tag));
@@ -1530,8 +1530,8 @@
 	     cd->l2 = get_verbatim_line2();
 	     if (cd->shared)
 	       {
-		  fprintf(stderr, "%s: Error. parse error %s:%i. There is already an existing \
                script section for the group\n",
-			  progname, file_in, line - 1);
+		  ERR("%s: Error. parse error %s:%i. There is already an existing script section \
for the group", +		      progname, file_in, line - 1);
 		  exit(-1);
 	       }
 	     cd->shared = s;
@@ -1562,8 +1562,8 @@
 	     cd->l2 = get_verbatim_line2();
 	     if (cd->shared)
 	       {
-		  fprintf(stderr, "%s: Error. parse error %s:%i. There is already an existing \
                script section for the group\n",
-			  progname, file_in, line - 1);
+		  ERR("%s: Error. parse error %s:%i. There is already an existing script section \
for the group", +		      progname, file_in, line - 1);
 		  exit(-1);
 	       }
 	     cd->shared = s;
@@ -1676,8 +1676,8 @@
 	  {
 	     if ((lep != ep) && (lep->name) && (!strcmp(lep->name, ep->name)))
 	       {
-		  fprintf(stderr, "%s: Error. parse error %s:%i. There is already a part of the \
                name %s\n",
-			  progname, file_in, line - 1, ep->name);
+		  ERR("%s: Error. parse error %s:%i. There is already a part of the name %s",
+		      progname, file_in, line - 1, ep->name);
 		  exit(-1);
 	       }
 	  }
@@ -2439,9 +2439,9 @@
 
    if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"box attributes in non-BOX or TABLE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "box attributes in non-BOX or TABLE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -2503,9 +2503,9 @@
 	s = parse_str(0);
 	if (strcmp(s, "GROUP"))
 	  {
-	     fprintf(stderr, "%s: Error. parse error %s:%i. "
-		     "token %s not one of: GROUP.\n",
-		     progname, file_in, line - 1, s);
+	     ERR("%s: Error. parse error %s:%i. "
+		 "token %s not one of: GROUP.",
+		 progname, file_in, line - 1, s);
 	     exit(-1);
 	  }
 	/* FIXME: handle the enum, once everything else is supported */
@@ -2826,12 +2826,12 @@
 
    if (ep->type != EDJE_PART_TYPE_TABLE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"table attributes in non-TABLE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "table attributes in non-TABLE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
-
+   
    item = eina_list_data_get(eina_list_last(ep->items));
    item->col = parse_int_range(0, 0, 0xffff);
    item->row = parse_int_range(1, 0, 0xffff);
@@ -2861,9 +2861,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TABLE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"table attributes in non-TABLE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "table attributes in non-TABLE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -3022,9 +3022,9 @@
    /* inherit may not be used in the default description */
    if (!ep->other_desc)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"inherit may not be used in the default description\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "inherit may not be used in the default description",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -3032,9 +3032,9 @@
 
    if (!ed->state.name)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"inherit may only be used after state\n",
-		progname, file_in, line - 1);
+        ERR("%s: Error. parse error %s:%i. "
+	    "inherit may only be used after state",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -3073,9 +3073,9 @@
 
    if (!parent)
      {
-	fprintf (stderr, "%s: Error. parse error %s:%i. "
-	      "cannot find referenced part state %s %lf\n",
-	      ep->name, file_in, line - 1, parent_name, parent_val);
+	ERR("%s: Error. parse error %s:%i. "
+	    "cannot find referenced part state %s %lf",
+	    ep->name, file_in, line - 1, parent_name, parent_val);
 	exit(-1);
      }
 
@@ -3169,9 +3169,9 @@
    s = parse_str(0);
    if (!strcmp (s, "custom"))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"invalid state name: '%s'.\n",
-		progname, file_in, line - 1, s);
+	ERR("%s: Error. parse error %s:%i. "
+	    "invalid state name: '%s'.",
+	    progname, file_in, line - 1, s);
 	exit(-1);
      }
 
@@ -3848,9 +3848,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"image attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "image attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -3891,9 +3891,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"image attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "image attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -3937,9 +3937,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"image attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "image attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -3977,9 +3977,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"image attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "image attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4019,9 +4019,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"image attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "image attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4083,9 +4083,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"fill.type attribute in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "fill.type attribute in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4158,9 +4158,9 @@
    /* XXX this will need to include IMAGES when angle support is added to evas \
images */  if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4196,9 +4196,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"fill attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "fill attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4253,9 +4253,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"fill attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "fill attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4289,9 +4289,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"fill attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "fill attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4350,9 +4350,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"fill attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "fill attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4386,9 +4386,9 @@
 
    if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"fill attributes in non-IMAGE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "fill attributes in non-IMAGE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4449,9 +4449,9 @@
    if ((ep->type != EDJE_PART_TYPE_TEXT) &&
        (ep->type != EDJE_PART_TYPE_TEXTBLOCK))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4501,9 +4501,9 @@
    if ((ep->type != EDJE_PART_TYPE_TEXT) &&
        (ep->type != EDJE_PART_TYPE_TEXTBLOCK))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4538,9 +4538,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4575,9 +4575,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXTBLOCK part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXTBLOCK part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4613,9 +4613,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXTBLOCK part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXTBLOCK part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4650,9 +4650,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4687,9 +4687,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4727,9 +4727,9 @@
    if ((ep->type != EDJE_PART_TYPE_TEXT) &&
        (ep->type != EDJE_PART_TYPE_TEXTBLOCK))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4767,9 +4767,9 @@
    if ((ep->type != EDJE_PART_TYPE_TEXT) &&
        (ep->type != EDJE_PART_TYPE_TEXTBLOCK))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4805,9 +4805,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4844,9 +4844,9 @@
    if ((ep->type != EDJE_PART_TYPE_TEXT) &&
        (ep->type != EDJE_PART_TYPE_TEXTBLOCK))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4888,9 +4888,9 @@
    if ((ep->type != EDJE_PART_TYPE_TEXT) &&
        (ep->type != EDJE_PART_TYPE_TEXTBLOCK))
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -4932,9 +4932,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TEXT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"text attributes in non-TEXT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "text attributes in non-TEXT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5002,9 +5002,9 @@
 
    if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5039,9 +5039,9 @@
 
    if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+        ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5084,9 +5084,9 @@
 
    if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5127,9 +5127,9 @@
 
    if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5157,12 +5157,12 @@
 
    if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
-
+   
    ed = ep->default_desc;
    if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
 
@@ -5187,9 +5187,9 @@
 
    if (ep->type != EDJE_PART_TYPE_GRADIENT)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"gradient attributes in non-GRADIENT part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "gradient attributes in non-GRADIENT part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5288,9 +5288,9 @@
 
    if (ep->type != EDJE_PART_TYPE_BOX)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"box attributes in non-BOX part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "box attributes in non-BOX part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5314,9 +5314,9 @@
 
    if (ep->type != EDJE_PART_TYPE_BOX)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"box attributes in non-BOX part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "box attributes in non-BOX part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5339,9 +5339,9 @@
 
    if (ep->type != EDJE_PART_TYPE_BOX)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"box attributes in non-BOX part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "box attributes in non-BOX part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5365,9 +5365,9 @@
 
    if (ep->type != EDJE_PART_TYPE_BOX)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"box attributes in non-BOX part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "box attributes in non-BOX part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5441,9 +5441,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TABLE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"table attributes in non-TABLE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "table attributes in non-TABLE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5469,9 +5469,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TABLE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"table attributes in non-TABLE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "table attributes in non-TABLE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5494,9 +5494,9 @@
 
    if (ep->type != EDJE_PART_TYPE_TABLE)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"table attributes in non-TABLE part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "table attributes in non-TABLE part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5524,9 +5524,9 @@
 
    if (ep->type != EDJE_PART_TYPE_EXTERNAL)
      {
-	fprintf(stderr, "%s: Error. parse error %s:%i. "
-		"params in non-EXTERNAL part.\n",
-		progname, file_in, line - 1);
+	ERR("%s: Error. parse error %s:%i. "
+	    "params in non-EXTERNAL part.",
+	    progname, file_in, line - 1);
 	exit(-1);
      }
 
@@ -5693,8 +5693,8 @@
 	  {
 	     if ((lep != ep) && (lep->name) && (!strcmp(lep->name, ep->name)))
 	       {
-		  fprintf(stderr, "%s: Error. parse error %s:%i. There is already a program of the \
                name %s\n",
-			  progname, file_in, line - 1, ep->name);
+		  ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n",
+		      progname, file_in, line - 1, ep->name);
 		  exit(-1);
 	       }
 	  }
@@ -5936,9 +5936,9 @@
 	  data_queue_part_lookup(pc, name, &(et->id));
 	else
 	  {
-	     fprintf(stderr, "%s: Error. parse error %s:%i. "
-		   "target may only be used after action\n",
-		   progname, file_in, line - 1);
+	     ERR("%s: Error. parse error %s:%i. "
+		 "target may only be used after action",
+		 progname, file_in, line - 1);
 	     exit(-1);
 	  }
 	free(name);
@@ -6010,8 +6010,8 @@
 	     cp->script = s;
 	     if (cd->shared && cd->is_lua)
 	       {
-		  fprintf(stderr, "%s: Error. parse error %s:%i. You're trying to mix Embryo and \
                Lua scripting in the same group\n",
-			progname, file_in, line - 1);
+		  ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting \
in the same group", +		      progname, file_in, line - 1);
 		  exit(-1);
 	       }
 	     cd->is_lua = 0;
@@ -6050,8 +6050,8 @@
 	     cp->script = s;
 	     if (cd->shared && !cd->is_lua)
 	       {
-		  fprintf(stderr, "%s: Error. parse error %s:%i. You're trying to mix Embryo and \
                Lua scripting in the same group\n",
-			progname, file_in, line - 1);
+		  ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting \
in the same group", +		      progname, file_in, line - 1);
 		  exit(-1);
 	       }
 	     cd->is_lua = 1;


["edje-lib.patch" (text/plain)]

Index: edje_program.c
===================================================================
--- edje_program.c	(revision 43803)
+++ edje_program.c	(working copy)
@@ -615,8 +615,8 @@
      }
    if ((recursions >= 64) || (recursion_limit))
      {
-	printf("EDJE ERROR: programs recursing up to recursion limit of %i. Disabled.\n",
-	       64);
+	ERR("Programs recursing up to recursion limit of %i. Disabled.",
+	    64);
 	recursion_limit = 1;
 	return;
      }
Index: edje_util.c
===================================================================
--- edje_util.c	(revision 43803)
+++ edje_util.c	(working copy)
@@ -59,7 +59,7 @@
 {
 #ifdef FASTFREEZE
    _edje_freeze_val++;
-   printf("fr ++ ->%i\n", _edje_freeze_val);
+   INF("fr ++ ->%i", _edje_freeze_val);
 #else
 // FIXME: could just have a global freeze instead of per object
 // above i tried.. but this broke some things. notable e17's menus. why?
@@ -109,7 +109,7 @@
 
 #ifdef FASTFREEZE
    _edje_freeze_val--;
-   printf("fr -- ->%i\n", _edje_freeze_val);
+   INF("fr -- ->%i", _edje_freeze_val);
    if ((_edje_freeze_val <= 0) && (_edje_freeze_calc_count > 0))
      {
 	Eina_List *l;
@@ -2070,9 +2070,8 @@
 
    if (_edje_box_layout_builtin_find(name))
      {
-	fprintf(stderr,
-		"ERROR: cannot register layout '%s': would override builtin!\n",
-		name);
+	ERR("Cannot register layout '%s': would override builtin!",
+	    name);
 
 	if (data && free_data) free_data(data);
 	return;
@@ -2417,11 +2416,11 @@
 	  }
 	if ((ed->w > 4000) || (ed->h > 4000))
 	  {
-	     printf("EDJE ERROR: file %s, group %s has a non-fixed part. add fixed: 1 1; \
???\n", +	     ERR("file %s, group %s has a non-fixed part. add fixed: 1 1; ???",
 		    ed->path, ed->group);
 	     if (pep)
-	       printf("  Problem part is: %s\n", pep->part->name);
-	     printf("  Will recalc min size not allowing broken parts to affect the \
result.\n"); +	       ERR("  Problem part is: %s", pep->part->name);
+	     ERR("  Will recalc min size not allowing broken parts to affect the result.");
 	     if (reset_maxwh)
 	       {
 		  reset_maxwh = 0;
@@ -2477,7 +2476,7 @@
    if (!rp)
      {
 	if (val_ret) *val_ret = 0;
-	printf("part not found\n");
+	INF("part not found");
 	return "";
      }
    if (rp->chosen_description)
Index: edje_load.c
===================================================================
--- edje_load.c	(revision 43803)
+++ edje_load.c	(working copy)
@@ -382,7 +382,7 @@
 		  rp->param1.description = ep->default_desc;
 		  rp->chosen_description = rp->param1.description;
 		  if (!rp->param1.description)
-		    printf("EDJE ERROR: no default part description!\n");
+		    ERR("no default part description!");
 
 		  switch (ep->type)
 		    {
@@ -1047,16 +1047,16 @@
    /* FIXME: free collection_hash and collection_cache */
    if (edf->collection_hash)
      {
-	printf("EDJE ERROR:\n"
-	       "\n"
-	       "Naughty Programmer - spank spank!\n"
-	       "\n"
-	       "This program as probably called edje_shutdown() with active Edje objects\n"
-	       "still around.\n This can cause problems as both Evas and Edje retain\n"
-	       "references to the objects. you should shut down all canvases and objects\n"
-	       "before calling edje_shutdown().\n"
-	       "The following errors are the edje object files and parts that are still\n"
-	       "hanging around, with their reference counts\n");
+	ERR("EDJE ERROR:\n"
+	    "\n"
+	    "Naughty Programmer - spank spank!\n"
+	    "\n"
+	    "This program as probably called edje_shutdown() with active Edje objects\n"
+	    "still around.\n This can cause problems as both Evas and Edje retain\n"
+	    "references to the objects. you should shut down all canvases and objects\n"
+	    "before calling edje_shutdown().\n"
+	    "The following errors are the edje object files and parts that are still\n"
+	    "hanging around, with their reference counts");
 	eina_hash_foreach(edf->collection_hash,
                           _edje_file_collection_hash_foreach, edf);
 	eina_hash_free(edf->collection_hash);
@@ -1173,9 +1173,9 @@
 
    edf = fdata;
    coll = data;
-   printf("EEK: EDJE FILE: \"%s\" ref(%i) PART: \"%s\" ref(%i) \n",
-	  edf->path, edf->references,
-	  coll->part, coll->references);
+   ERR("EEK: EDJE FILE: \"%s\" ref(%i) PART: \"%s\" ref(%i) ",
+       edf->path, edf->references,
+       coll->part, coll->references);
    _edje_collection_free(edf, coll);
 
    return 1;
Index: edje_private.h
===================================================================
--- edje_private.h	(revision 43803)
+++ edje_private.h	(working copy)
@@ -25,7 +25,28 @@
 
 #include <lua.h>
 #include <lauxlib.h>
+EAPI extern int _edje_default_log_dom ; 
 
+#ifdef EDJE_DEFAULT_LOG_COLOR
+# undef EDJE_DEFAULT_LOG_COLOR
+#endif
+#define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_edje_default_log_dom, __VA_ARGS__)
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_edje_default_log_dom, __VA_ARGS__)
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_edje_default_log_dom, __VA_ARGS__)
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__)
 #ifdef __GNUC__
 # if __GNUC__ >= 4
 // BROKEN in gcc 4 on amd64
Index: edje_lua.c
===================================================================
--- edje_lua.c	(revision 43803)
+++ edje_lua.c	(working copy)
@@ -163,7 +163,7 @@
 	err_type = "unknown";
 	break;
      }
-   fprintf(stderr, "Lua %s error: %s\n", err_type, lua_tostring(L, -1));
+   ERR("Lua %s error: %s", err_type, lua_tostring(L, -1));
    // don't exit. this is BAD. lua script bugs will cause thngs like e to
    // exit mysteriously endig your x session. bad!
    // exit(-1);
@@ -5029,9 +5029,8 @@
    ela->cur += nsize - osize;
    if (ela->cur > ela->max)
      {
-	fprintf(stderr, 
-                "Edje Lua memory limit of %i bytes reached (%i allocated)\n",
-                ela->max, ela->cur);
+        ERR("Edje Lua memory limit of %i bytes reached (%i allocated)",
+	    ela->max, ela->cur);
 	return NULL;
      }
    if (nsize == 0)
@@ -5055,7 +5054,7 @@
    Ledje = lua_newstate(_edje_lua_alloc, &ela);
    if (!Ledje)
      {
-	fprintf(stderr, "Lua error: Lua state could not be initialized\n");
+	ERR("Lua error: Lua state could not be initialized");
 	exit(-1);
      }
 
Index: edje_external.c
===================================================================
--- edje_external.c	(revision 43803)
+++ edje_external.c	(working copy)
@@ -12,7 +12,7 @@
 {
    if (eina_hash_find(type_registry, type_name))
      {
-	printf("EDJE ERROR: external type '%s' already registered\n", type_name);
+	ERR("External type '%s' already registered", type_name);
 	return EINA_FALSE;
      }
    return eina_hash_add(type_registry, type_name, type_info);
@@ -129,13 +129,13 @@
    obj = type->add(type->data, evas, parent, params);
    if (!obj)
      {
-	printf("EDJE ERROR: external type '%s' returned NULL from constructor\n", \
type_name); +	ERR("External type '%s' returned NULL from constructor", type_name);
 	return NULL;
      }
 
    evas_object_data_set(obj, "Edje_External_Type", type);
 
-   printf("evas object: %p, external type: %p, data_get: %p\n", obj, type, \
evas_object_data_get(obj, "Edje_External_Type")); +   ERR("Evas object: %p, external \
type: %p, data_get: %p", obj, type, evas_object_data_get(obj, "Edje_External_Type")); \
return obj;  }
 
@@ -147,7 +147,7 @@
    type = evas_object_data_get(obj, "Edje_External_Type");
    if (!type)
      {
-	printf("EDJE ERROR: external type data not found.\n");
+	ERR("External type data not found.");
 	return;
      }
 
Index: edje_main.c
===================================================================
--- edje_main.c	(revision 43803)
+++ edje_main.c	(working copy)
@@ -7,18 +7,10 @@
 #include "edje_private.h"
 
 static int _edje_init_count = 0;
-static int _edje_log_dom_global = -1;
+int _edje_default_log_dom = -1;
 Eina_Mempool *_edje_real_part_mp = NULL;
 Eina_Mempool *_edje_real_part_state_mp = NULL;
 
-#ifdef EDJE_DEFAULT_LOG_COLOR
-# undef EDJE_DEFAULT_LOG_COLOR
-#endif
-#define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
-#ifdef ERR
-# undef ERR
-#endif
-#define ERR(...) EINA_LOG_DOM_ERR(_edje_log_dom_global, __VA_ARGS__)
 
 
 /*============================================================================*
@@ -68,8 +60,8 @@
 	return --_edje_init_count;
      }
 
-   _edje_log_dom_global = eina_log_domain_register("Edje", EDJE_DEFAULT_LOG_COLOR);
-   if (_edje_log_dom_global < 0)
+   _edje_default_log_dom = eina_log_domain_register("Edje", EDJE_DEFAULT_LOG_COLOR);
+   if (_edje_default_log_dom < 0)
      {
 	EINA_LOG_ERR("Edje Can not create a general log domain.");
 	goto shutdown_eina;
@@ -138,8 +130,8 @@
  shutdown_ecore_job:
    ecore_job_shutdown();
  unregister_log_domain:
-   eina_log_domain_unregister(_edje_log_dom_global);
-   _edje_log_dom_global = -1;
+   eina_log_domain_unregister(_edje_default_log_dom);
+   _edje_default_log_dom = -1;
  shutdown_eina:
    eina_shutdown();
    return --_edje_init_count;
@@ -194,8 +186,8 @@
    eet_shutdown();
    embryo_shutdown();
    ecore_job_shutdown();
-   eina_log_domain_unregister(_edje_log_dom_global);
-   _edje_log_dom_global = -1;
+   eina_log_domain_unregister(_edje_default_log_dom);
+   _edje_default_log_dom = -1;
    eina_shutdown();
 
    return _edje_init_count;
Index: edje_edit.c
===================================================================
--- edje_edit.c	(revision 43803)
+++ edje_edit.c	(working copy)
@@ -72,8 +72,8 @@
 
    mem = calloc(1, size);
    if (mem) return mem;
-   fprintf(stderr, "Edje_Edit: Error. memory allocation of %i bytes failed. %s\n",
-           (int)size, strerror(errno));
+   ERR("Edje_Edit: Error. memory allocation of %i bytes failed. %s",
+       (int)size, strerror(errno));
    return NULL;
 }
 
@@ -227,10 +227,10 @@
    evas_object_image_file_set(im, path, NULL);
    if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
      {
-	fprintf(stderr, "Edje_Edit: Error. unable to load image \"%s\"."
-		"Missing PNG or JPEG loader modules for Evas or "
-		"file does not exist, or is not readable.\n", path);
-	evas_object_del(im);
+        ERR("Edje_Edit: unable to load image \"%s\"."
+	    "Missing PNG or JPEG loader modules for Evas or "
+	    "file does not exist, or is not readable.", path);
+        evas_object_del(im);
 	im = NULL;
 	return 0;
      }
@@ -252,8 +252,7 @@
    eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE);
    if (!eetf)
      {
-	fprintf(stderr,
-		"Edje_Edit: Error. unable to open \"%s\" for writing output\n",
+	ERR("Edje_Edit: Error. unable to open \"%s\" for writing output",
 		ed->path);
 	evas_object_del(im);
 	return 0;
@@ -269,8 +268,8 @@
 				0, 100, 1);
    if (bytes <= 0)
      {
-	fprintf(stderr, "Edje_Edit: Error. unable to write image part \"%s\" "
-	"part entry to %s\n", buf, ed->path);
+	ERR("Edje_Edit: Error. unable to write image part \"%s\" "
+	    "part entry to %s", buf, ed->path);
 	evas_object_del(im);
 	return 0;
      }
@@ -282,8 +281,8 @@
    bytes = eet_data_write(eetf, _edje_edd_edje_file, "edje_file", ed->file, 1);
    if (bytes <= 0)
      {
-	fprintf(stderr, "Edje_Edit: Error. unable to write \"edje_file\" "
-	        "entry to \"%s\" \n", ed->path);
+	ERR("Edje_Edit: Error. unable to write \"edje_file\" "
+	    "entry to \"%s\"", ed->path);
 	eet_close(eetf);
 	return 0;
      }
@@ -763,8 +762,8 @@
    eetf = eet_open(ed->file->path, EET_FILE_MODE_READ_WRITE);
    if (!eetf)
      {
-	fprintf(stderr, "Edje_Edit: Error. unable to open \"%s\" "
-	        "for writing output\n", ed->file->path);
+	ERR("Edje_Edit: Error. unable to open \"%s\" "
+	    "for writing output", ed->file->path);
 	return 0;
      }
    snprintf(buf, sizeof(buf), "collections/%d", g->id);
@@ -3645,8 +3644,8 @@
 	  {
 	     if (fread(fdata, pos, 1, f) != 1)
 	       {
-		  fprintf(stderr, "Edje_Edit: Error. unable to read all of font file \"%s\"\n",
-			  path);
+		  ERR("Edje_Edit: Error. unable to read all of font file \"%s\"",
+		      path);
 		  return 0;
 	       }
 	     fsize = pos;
@@ -3662,16 +3661,15 @@
 	eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE);
 	if (!eetf)
 	  {
-	     fprintf(stderr,
-		     "Edje_Edit: Error. unable to open \"%s\" for writing output\n",
-		     ed->path);
+	    ERR("Edje_Edit: Error. unable to open \"%s\" for writing output",
+		ed->path);
 	     return 0;
 	  }
 
 	if (eet_write(eetf, buf, fdata, fsize, 1) <= 0)
 	  {
-	     fprintf(stderr, "Edje_Edit: Error. unable to write font part \"%s\" as \"%s\" \
                part entry\n",
-		     path, buf);
+	     ERR("Edje_Edit: Error. unable to write font part \"%s\" as \"%s\" part entry",
+		 path, buf);
 	     eet_close(eetf);
 	     free(fdata);
 	     return 0;
@@ -5728,7 +5726,7 @@
    strcpy(tmpn, "/tmp/edje_edit.edc-tmp-XXXXXX");
 #endif
    if (!(fd = mkstemp(tmpn))) return NULL;
-   printf("*** tmp file: %s\n", tmpn);
+   INF("*** tmp file: %s", tmpn);
    if (!(f = fdopen(fd, "wb"))) return NULL;
 
    /* Write edc into file */
@@ -5885,8 +5883,8 @@
    ef = ed->file;
    if (!ef) return 0;
 
-   printf("***********  Saving file ******************\n");
-   printf("** path: %s\n", ef->path);
+   INF("***********  Saving file ******************");
+   INF("** path: %s", ef->path);
    
    /* Set compiler name */
    if (strcmp(ef->compiler, "edje_edit"))
@@ -5899,18 +5897,18 @@
    eetf = eet_open(ef->path, EET_FILE_MODE_READ_WRITE);
    if (!eetf)
      {
-	fprintf(stderr, "Error. unable to open \"%s\" for writing output\n",
-	        ef->path);
+	ERR("Error. unable to open \"%s\" for writing output",
+	    ef->path);
 	return 0;
      }
 
    /* Write Edje_File structure */
-   printf("** Writing Edje_File* ed->file\n");
+   INF("** Writing Edje_File* ed->file");
    bytes = eet_data_write(eetf, _edje_edd_edje_file, "edje_file", ef, 1);
    if (bytes <= 0)
      {
-	fprintf(stderr, "Error. unable to write \"edje_file\" "
-	        "entry to \"%s\" \n", ef->path);
+	ERR("Error. unable to write \"edje_file\" "
+	    "entry to \"%s\"", ef->path);
 	eet_close(eetf);
 	return 0;
      }
@@ -5918,8 +5916,8 @@
    /* Write all the collections */
    if (ed->collection)
      {
-	printf("** Writing Edje_Part_Collection* ed->collection "
-	       "[id: %d]\n", ed->collection->id);
+       ERR("** Writing Edje_Part_Collection* ed->collection "
+	   "[id: %d]", ed->collection->id);
 
 	snprintf(buf, sizeof(buf), "collections/%i", ed->collection->id);
 
@@ -5927,8 +5925,8 @@
 	                       buf, ed->collection, 1);
 	if (bytes <= 0)
 	  {
-		fprintf(stderr, "Error. unable to write \"%s\" part entry to %s \n",
-		        buf, ef->path);
+		ERR("Error. unable to write \"%s\" part entry to %s",
+		    buf, ef->path);
 		eet_close(eetf);
 		return 0;
 	  }
@@ -5944,11 +5942,11 @@
    source_file = _edje_generate_source(obj);
    if (!source_file)
      {
-	fprintf(stderr, "Error: can't create edc source\n");
+	ERR("Error: can't create edc source");
 	eet_close(eetf);
 	return 0;
      }
-   printf("** Writing EDC Source [from: %s]\n", source_file);
+   INF("** Writing EDC Source [from: %s]", source_file);
 
    //open the temp file and put the contents in SrcFile
    sf = _alloc(sizeof(SrcFile));
@@ -5958,8 +5956,8 @@
    f = fopen(source_file, "rb");
    if (!f)
      {
-	fprintf(stderr, "Error. unable to read the created edc source [%s]\n",
-	        source_file);
+	ERR("Error. unable to read the created edc source [%s]",
+	    source_file);
 	eet_close(eetf);
 	return 0;
      }
@@ -5984,7 +5982,7 @@
    bytes = eet_data_write(eetf, _srcfile_list_edd, "edje_sources", sfl, 1);
    if (bytes <= 0)
     {
-	fprintf(stderr, "Error. unable to write edc source\n");
+	ERR("Error. unable to write edc source");
 	eet_close(eetf);
 	return 0;
     }
@@ -5993,7 +5991,7 @@
    unlink(source_file);
    eina_stringshare_del(source_file);
    eet_close(eetf);
-   printf("***********  Saving DONE ******************\n");
+   INF("***********  Saving DONE ******************");
    return 1;
 }
 
@@ -6009,15 +6007,15 @@
    _edje_generate_source(obj);
    return;
    
-   printf("\n****** CHECKIN' INTERNAL STRUCTS STATUS *********\n");
+   INF("\n****** CHECKIN' INTERNAL STRUCTS STATUS *********");
 
-   printf("*** Edje\n");
-   printf("    path: '%s'\n", ed->path);
-   printf("    group: '%s'\n", ed->group);
-   printf("    parent: '%s'\n", ed->parent);
+   INF("*** Edje\n");
+   INF("    path: '%s'", ed->path);
+   INF("    group: '%s'", ed->group);
+   INF("    parent: '%s'", ed->parent);
 
-   printf("\n*** Parts [table:%d list:%d]\n", ed->table_parts_size,
-          eina_list_count(ed->collection->parts));
+   INF("*** Parts [table:%d list:%d]", ed->table_parts_size,
+       eina_list_count(ed->collection->parts));
    EINA_LIST_FOREACH(ed->collection->parts, l, p)
      {
 	Edje_Real_Part *rp;
@@ -6027,10 +6025,10 @@
 	if (p == rp->part)
 	  printf(" OK!\n");
 	else
-	  printf(" WRONG (table[%id]->name = '%s')\n", p->id, rp->part->name);
+	  WRN(" WRONG (table[%id]->name = '%s')", p->id, rp->part->name);
      }
 
-   printf("\n*** Programs [table:%d list:%d]\n", ed->table_programs_size,
+   INF("*** Programs [table:%d list:%d]", ed->table_programs_size,
           eina_list_count(ed->collection->programs));
    EINA_LIST_FOREACH(ed->collection->programs, l, epr)
      {
@@ -6041,10 +6039,10 @@
 	if (epr == epr2)
 	  printf(" OK!\n");
 	else
-	  printf(" WRONG (table[%id]->name = '%s')\n", epr->id, epr2->name);
+	  WRN(" WRONG (table[%id]->name = '%s')", epr->id, epr2->name);
      }
 
    printf("\n");
 
-   printf("******************  END  ************************\n\n");
+   INF("******************  END  ************************\n");
 }
Index: edje_match.c
===================================================================
--- edje_match.c	(revision 43803)
+++ edje_match.c	(working copy)
@@ -288,7 +288,7 @@
           r->patterns[i] = str;                                 \
                                                                 \
           if (Show)                                             \
-            fprintf(stderr, "%i [%s]\n", i, str);               \
+            INF("%i [%s]", i, str);                             \
                                                                 \
           r->finals[i] = 0;                                     \
           for (j = 0; str[j]; ++j)                              \
Index: edje_embryo.c
===================================================================
--- edje_embryo.c	(revision 43803)
+++ edje_embryo.c	(working copy)
@@ -2354,19 +2354,19 @@
 	ret = embryo_program_run(ed->collection->script, fn);
 	if (ret == EMBRYO_PROGRAM_FAIL)
 	  {
-	     printf("EDJE:        ERROR with embryo script.\n"
-		    "ENTRY POINT: %s\n"
-		    "ERROR:       %s\n",
-		    fname,
-		    embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
+ 	     ERR("ERROR with embryo script.\n"
+	 	 "ENTRY POINT: %s\n"
+		 "ERROR:       %s",
+		 fname,
+		 embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
 	  }
 	else if (ret == EMBRYO_PROGRAM_TOOLONG)
 	  {
-	     printf("EDJE:        ERROR with embryo script.\n"
-		    "ENTRY POINT: %s\n"
-		    "ERROR:       Script exceeded maximum allowed cycle count of %i\n",
-		    fname,
-		    embryo_program_max_cycle_run_get(ed->collection->script));
+	     ERR("ERROR with embryo script.\n"
+		 "ENTRY POINT: %s\n"
+		 "ERROR:       Script exceeded maximum allowed cycle count of %i",
+		 fname,
+		 embryo_program_max_cycle_run_get(ed->collection->script));
 	  }
 	embryo_program_data_set(ed->collection->script, pdata);
      }
Index: edje_calc.c
===================================================================
--- edje_calc.c	(revision 43803)
+++ edje_calc.c	(working copy)
@@ -1410,8 +1410,8 @@
 	if ((!chosen_desc->box.alt_layout) ||
 	    (!_edje_box_layout_find(chosen_desc->box.alt_layout, &layout, &data, \
&free_data)))  {
-	     fprintf(stderr, "ERROR: box layout '%s' (fallback '%s') not available, using \
                horizontal.\n",
-		     chosen_desc->box.layout, chosen_desc->box.alt_layout);
+	     ERR("ERROR: box layout '%s' (fallback '%s') not available, using horizontal.",
+		 chosen_desc->box.layout, chosen_desc->box.alt_layout);
 	     layout = evas_object_box_layout_horizontal;
 	     free_data = NULL;
 	     data = NULL;
@@ -1504,11 +1504,11 @@
 	    }
 	if (image_id < 0)
 	  {
-	     printf("EDJE ERROR: part \"%s\" has description, "
-		    "\"%s\" %3.3f with a missing image id!!!\n",
-		    ep->part->name,
-		    ep->param1.description->state.name,
-		    ep->param1.description->state.value);
+	     ERR(" ¨Part \"%s\" has description, "
+		 "\"%s\" %3.3f with a missing image id!!!",
+		 ep->part->name,
+		 ep->param1.description->state.name,
+		 ep->param1.description->state.value);
 	  }
 	else
 	  {
@@ -1522,28 +1522,28 @@
 	     evas_object_image_file_set(ep->object, ed->file->path, buf);
 	     if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE)
 	       {
-		  printf("EDJE: Error loading image collection \"%s\" from "
-			 "file \"%s\". Missing EET Evas loader module?\n",
-			 buf, ed->file->path);
+		  ERR("Error loading image collection \"%s\" from "
+		      "file \"%s\". Missing EET Evas loader module?",
+		      buf, ed->file->path);
 		  switch (evas_object_image_load_error_get(ep->object))
 		    {
 		     case EVAS_LOAD_ERROR_GENERIC:
-			printf("Error type: EVAS_LOAD_ERROR_GENERIC\n");
+			ERR("Error type: EVAS_LOAD_ERROR_GENERIC");
 			break;
 		     case EVAS_LOAD_ERROR_DOES_NOT_EXIST:
-			printf("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST\n");
+			ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST");
 			break;
 		     case EVAS_LOAD_ERROR_PERMISSION_DENIED:
-			printf("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED\n");
+			ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED");
 			break;
 		     case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
-			printf("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED\n");
+			ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED");
 			break;
 		     case EVAS_LOAD_ERROR_CORRUPT_FILE:
-			printf("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE\n");
+			ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE");
 			break;
 		     case EVAS_LOAD_ERROR_UNKNOWN_FORMAT:
-			printf("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT\n");
+			ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT");
 			break;
 		    }
 	       }
@@ -1592,12 +1592,12 @@
 	  faxes = "X";
 	else if ((flags & FLAG_Y))
 	  faxes = "Y";
-	printf("EDJE ERROR: Circular dependency when calculating part \"%s\"\n"
-	       "            Already calculating %s [%02x] axes\n"
-	       "            Need to calculate %s [%02x] axes\n",
-	       ep->part->name,
-	       axes, ep->calculating,
-	       faxes, flags);
+	ERR("Circular dependency when calculating part \"%s\"\n"
+	    "Already calculating %s [%02x] axes\n"
+	    "Need to calculate %s [%02x] axes",
+	    ep->part->name,
+	    axes, ep->calculating,
+	    faxes, flags);
 #endif
 	return;
      }
Index: edje_cache.c
===================================================================
--- edje_cache.c	(revision 43803)
+++ edje_cache.c	(working copy)
@@ -105,12 +105,12 @@
 	if ((err_code = luaL_loadbuffer(edc->L, data, size, "edje_lua_script")))
 	  {
 	     if (err_code == LUA_ERRSYNTAX)
-	       printf("lua load syntax error: %s\n", lua_tostring(edc->L, -1));
+	       ERR("lua load syntax error: %s", lua_tostring(edc->L, -1));
 	     else if (err_code == LUA_ERRMEM)
-	       printf("lua load memory allocation error: %s\n", lua_tostring(edc->L, -1));
+	       ERR("lua load memory allocation error: %s", lua_tostring(edc->L, -1));
 	  }
 	if (lua_pcall(edc->L, 0, 0, 0))
-	  printf("lua call error: %s\n", lua_tostring(edc->L, -1));
+	  ERR("lua call error: %s", lua_tostring(edc->L, -1));
 	free(data);
      }
    
@@ -315,7 +315,7 @@
 		       ep2 = eina_list_nth(edc->parts, ep2->dragable.confine_id);
 		       if (eina_list_data_find(hist, ep2))
 			 {
-			    printf("EDJE ERROR: confine_to loops. invalidating loop.\n");
+			    ERR("confine_to loops. invalidating loop.");
 			    ep2->dragable.confine_id = -1;
 			    break;
 			 }
@@ -340,7 +340,7 @@
 
 		       if (eina_list_data_find(hist, ep2))
 			 {
-			    printf("EDJE ERROR: events_to loops. invalidating loop.\n");
+			    ERR("events_to loops. invalidating loop.");
 			    ep2->dragable.events_id = -1;
 			    break;
 			 }
@@ -355,7 +355,7 @@
 		       ep2 = eina_list_nth(edc->parts, ep2->clip_to_id);
 		       if (eina_list_data_find(hist, ep2))
 			 {
-			    printf("EDJE ERROR: clip_to loops. invalidating loop.\n");
+			    ERR("clip_to loops. invalidating loop.");
 			    ep2->clip_to_id = -1;
 			    break;
 			 }
Index: edje_script_only.c
===================================================================
--- edje_script_only.c	(revision 43803)
+++ edje_script_only.c	(working copy)
@@ -643,18 +643,18 @@
    ret = embryo_program_run(ed->collection->script, fn);
    if (ret == EMBRYO_PROGRAM_FAIL)
      {
-	printf("EDJE:        ERROR with embryo script.\n"
-	       "ENTRY POINT: %s\n"
-	       "ERROR:       %s\n",
+	ERR("ERROR with embryo script.\n"
+	    "ENTRY POINT: %s\n"
+	    "ERROR:       %s",
 	       fname,
 	       embryo_error_string_get(embryo_program_error_get
 				       (ed->collection->script)));
      }
    else if (ret == EMBRYO_PROGRAM_TOOLONG)
      {
-	printf("EDJE:        ERROR with embryo script.\n"
-	       "ENTRY POINT: %s\n"
-	       "ERROR:       Script exceeded maximum allowed cycle count of %i\n",
-	       fname, embryo_program_max_cycle_run_get(ed->collection->script));
+	ERR("ERROR with embryo script.\n"
+	    "ENTRY POINT: %s\n"
+	    "ERROR:       Script exceeded maximum allowed cycle count of %i",
+	    fname, embryo_program_max_cycle_run_get(ed->collection->script));
      }
 }



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic