better log.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 8 Oct 2010 00:24:22 +0000 (00:24 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 8 Oct 2010 00:24:22 +0000 (00:24 +0000)
 * lower case domain names;

 * binaries use their own color (EDJE_CC_DEFAULT_LOG_COLOR)

 * log messages do not take multiple lines, it's annoying. The colors
   should call your attention already.

 * the ever annoying "did you forgot fixed: 1 1;" message that used to
   consume 3 lines is now bit more descriptive and uses a single line.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@53178 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

14 files changed:
src/bin/edje_cc.c
src/bin/edje_convert_main.c
src/bin/edje_decc.c
src/lib/edje_calc.c
src/lib/edje_convert.c
src/lib/edje_edit.c
src/lib/edje_embryo.c
src/lib/edje_load.c
src/lib/edje_lua.c
src/lib/edje_main.c
src/lib/edje_message_queue.c
src/lib/edje_script_only.c
src/lib/edje_util.c
src/lib/edje_var.c

index b5068a8..2643ae7 100644 (file)
@@ -61,8 +61,9 @@ main(int argc, char **argv)
    if (!eina_init())
      return -1;
 
-   _edje_cc_log_dom = eina_log_domain_register("EDJE_CC", EDJE_DEFAULT_LOG_COLOR);
-   if(_edje_cc_log_dom<0)
+   _edje_cc_log_dom = eina_log_domain_register
+     ("edje_cc", EDJE_CC_DEFAULT_LOG_COLOR);
+   if (_edje_cc_log_dom < 0)
      {
        EINA_LOG_ERR("Enable to create a log domain.");
        exit(-1);
index da2189c..0d12976 100644 (file)
@@ -118,8 +118,9 @@ main(int argc, char **argv)
    if (!eina_init())
      return -1;
 
-   _edje_cc_log_dom = eina_log_domain_register("EDJE_CONVERT", EDJE_DEFAULT_LOG_COLOR);
-   if(_edje_cc_log_dom<0)
+   _edje_cc_log_dom = eina_log_domain_register
+     ("edje_convert", EDJE_CC_DEFAULT_LOG_COLOR);
+   if (_edje_cc_log_dom < 0)
      {
        EINA_LOG_ERR("Enable to create a log domain.");
        exit(-1);
index 4cbdce8..31036ed 100644 (file)
@@ -61,10 +61,11 @@ main(int argc, char **argv)
    setlocale(LC_NUMERIC, "C");
    if (!eina_init())
      exit(-1);
-   _edje_cc_log_dom = eina_log_domain_register("edje_decc", EDJE_CC_DEFAULT_LOG_COLOR);
-   if(_edje_cc_log_dom < 0)
+   _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_LOG_ERR("Impossible to create a log domain.");
        eina_shutdown();
        exit(-1);
      }
index dae59db..8a113b8 100644 (file)
@@ -1675,8 +1675,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
          faxes = "X";
        else if ((flags & FLAG_Y))
          faxes = "Y";
-       ERR("Circular dependency when calculating part \"%s\"\n"
-           "Already calculating %s [%02x] axes\n"
+       ERR("Circular dependency when calculating part \"%s\""
+           "Already calculating %s [%02x] axes"
            "Need to calculate %s [%02x] axes",
            ep->part->name,
            axes, ep->calculating,
index 6b183fd..07d43ce 100644 (file)
@@ -37,19 +37,18 @@ _edje_collection_string_free(void *data)
        edf = (Edje_File*) _edje_file_get();
 
        if (!edf->warning)
-         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");
+         CRITICAL("This program as probably called edje_shutdown() with "
+                   "active Edje objects still around. "
+                   "This can cause problems as both Evas and Edje retain "
+                   "references to the objects. "
+                   "You should shut down all canvases and objects "
+                   "before calling edje_shutdown(). "
+                   "The following errors are the edje object files and "
+                   "parts that are still hanging around, with their reference "
+                   "counts");
 
        edf->warning = 1;
-       ERR("EEK: EDJE FILE: \"%s\" ref(%i) PART: \"%s\" ref(%i) ",
+       ERR("file: '%s', references: %i, part: '%s', references: %i",
            edf->path, edf->references,
            ce->ref->part, ce->ref->references);
 
index 22bcebf..ae0ba0c 100644 (file)
@@ -4202,7 +4202,7 @@ edje_edit_font_add(Evas_Object *obj, const char* path, const char* alias)
 
    GET_ED_OR_RETURN(EINA_FALSE);
 
-   INF("ADD FONT: %s\n", path);
+   INF("ADD FONT: %s", path);
 
    if (!path) return EINA_FALSE;
    if (stat(path, &st) || !S_ISREG(st.st_mode)) return EINA_FALSE;
@@ -4268,7 +4268,7 @@ edje_edit_font_del(Evas_Object *obj, const char* alias)
 
    GET_ED_OR_RETURN(EINA_FALSE);
 
-   INF("DEL FONT: %s\n", alias);
+   INF("DEL FONT: %s", alias);
 
    if (!alias) return EINA_FALSE;
    if (!ed->file) return EINA_FALSE;
@@ -6887,14 +6887,12 @@ edje_edit_print_internal_status(Evas_Object *obj)
    _edje_generate_source(obj);
    return;
 
-   INF("\n****** CHECKIN' INTERNAL STRUCTS STATUS *********");
+   INF("****** CHECKIN' INTERNAL STRUCTS STATUS *********");
 
-   INF("*** Edje\n");
-   INF("    path: '%s'", ed->path);
-   INF("    group: '%s'", ed->group);
-   INF("    parent: '%s'", ed->parent);
+   INF("path: '%s', group: '%s', parent: '%s'",
+       ed->path, ed->group, ed->parent);
 
-   INF("*** Parts [table:%d list:%d]", ed->table_parts_size,
+   INF("Parts [table:%d list:%d]", ed->table_parts_size,
        ed->collection->parts_count);
    for (i = 0; i < ed->collection->parts_count; ++i)
      {
@@ -6904,14 +6902,14 @@ edje_edit_print_internal_status(Evas_Object *obj)
        p = ed->collection->parts[i];
 
        rp = ed->table_parts[p->id % ed->table_parts_size];
-       printf("    [%d]%s ", p->id, p->name);
+       printf("part[%d]: '%s' ", p->id, p->name);
        if (p == rp->part)
-         printf(" OK!\n");
+         printf("OK!\n");
        else
-         WRN(" WRONG (table[%id]->name = '%s')", p->id, rp->part->name);
+         printf("WRONG (table[%d]->name = '%s')\n", p->id, rp->part->name);
      }
 
-   INF("*** Programs [table:%d list:%d,%d,%d,%d,%d]", ed->table_programs_size,
+   INF("Programs [table:%d list:%d,%d,%d,%d,%d]", ed->table_programs_size,
        ed->collection->programs.fnmatch_count,
        ed->collection->programs.strcmp_count,
        ed->collection->programs.strncmp_count,
@@ -6920,10 +6918,8 @@ edje_edit_print_internal_status(Evas_Object *obj)
    for(j = 0; j < ed->table_programs_size; ++j)
      {
        epr = ed->table_programs[i % ed->table_programs_size];
-       printf("     [%d]%s\n", epr->id, epr->name);
+       printf("program[%d]: '%s'\n", epr->id, epr->name);
      }
 
-   printf("\n");
-
-   INF("******************  END  ************************\n");
+   INF("******************  END  ************************");
 }
index e0c3d4a..ceeea66 100644 (file)
@@ -3031,12 +3031,13 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *
        ret = embryo_program_run(ed->collection->script, fn);
        if (ret == EMBRYO_PROGRAM_FAIL)
          {
-            ERR("ERROR with embryo script.\n"
-                 "OBJECT NAME: %s\n"
-                 "OBJECT FILE: %s\n"
-                 "ENTRY POINT: %s\n"
-                 "SIGNAL/SRC:  %s / %s\n"
-                "ERROR:       %s",
+            ERR("ERROR with embryo script. "
+                 "OBJECT NAME: '%s', "
+                 "OBJECT FILE: '%s', "
+                 "ENTRY POINT: '%s', "
+                 "SIGNAL: '%s', "
+                 "SOURCE: '%s', "
+                "ERROR: '%s'",
                  ed->collection->part,
                  ed->file->path,
                  fname,
@@ -3045,12 +3046,13 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *
          }
        else if (ret == EMBRYO_PROGRAM_TOOLONG)
          {
-            ERR("ERROR with embryo script.\n"
-                 "OBJECT NAME: %s\n"
-                 "OBJECT FILE: %s\n"
-                 "ENTRY POINT: %s\n"
-                 "SIGNAL/SRC:  %s / %s\n"
-                "ERROR:       Script exceeded maximum allowed cycle count of %i",
+            ERR("ERROR with embryo script. "
+                 "OBJECT NAME: '%s', "
+                 "OBJECT FILE: '%s', "
+                 "ENTRY POINT: '%s', "
+                 "SIGNAL: '%s', "
+                 "SOURCE: '%s', "
+                "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
                  ed->collection->part,
                  ed->file->path,
                 fname,
index 4a1ac1b..52a72f6 100644 (file)
@@ -461,7 +461,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
                        rp->object = evas_object_table_add(ed->evas);
                        break;
                     case EDJE_PART_TYPE_GRADIENT:
-                       ERR("SPANK ! SPANK ! SPANK !\nYOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !!\n THEY ARE NOW REMOVED !",
+                       ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
                            ep->name, group, file);
                     default:
                        ERR("wrong part type %i!", ep->type);
index 7b599b9..3776fbc 100644 (file)
@@ -120,7 +120,7 @@ jmp_buf _edje_lua_panic_jmp;
 static int
 _edje_lua_custom_panic(__UNUSED__ lua_State *L)
 {
-   printf("PANIC\n");
+   CRITICAL("PANIC");
    longjmp(_edje_lua_panic_jmp, 1);
    return 1; /* longjmp() never returns, but this keep gcc happy */
 }
@@ -5049,7 +5049,7 @@ _edje_lua_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
    /* ANSI requires that realloc(NULL, size) == malloc(size) */
    ptr2 = realloc(ptr, nsize);
    if (ptr2) return ptr2;
-   ERR("Edje Lua cannot re-allocate %zu bytes\n", nsize);
+   ERR("Edje Lua cannot re-allocate %zu bytes", nsize);
    return ptr2;
 }
 
index 6ac0221..9c63b0a 100644 (file)
@@ -55,7 +55,8 @@ edje_init(void)
        return --_edje_init_count;
      }
 
-   _edje_default_log_dom = eina_log_domain_register("Edje", EDJE_DEFAULT_LOG_COLOR);
+   _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.");
index 8d0b029..b8a5f20 100644 (file)
@@ -687,11 +687,11 @@ _edje_message_process(Edje_Message *em)
    ret = embryo_program_run(em->edje->collection->script, fn);
    if (ret == EMBRYO_PROGRAM_FAIL)
      {
-        ERR("ERROR with embryo script.\n"
-            "OBJECT NAME: %s\n"
-            "OBJECT FILE: %s\n"
-            "ENTRY POINT: %s\n"
-            "ERROR:       %s",
+        ERR("ERROR with embryo script. "
+            "OBJECT NAME: '%s', "
+            "OBJECT FILE: '%s', "
+            "ENTRY POINT: '%s', "
+            "ERROR: '%s'",
             em->edje->collection->part,
             em->edje->file->path,
             "message",
@@ -699,11 +699,11 @@ _edje_message_process(Edje_Message *em)
      }
    else if (ret == EMBRYO_PROGRAM_TOOLONG)
      {
-        ERR("ERROR with embryo script.\n"
-            "OBJECT NAME: %s\n"
-            "OBJECT FILE: %s\n"
-            "ENTRY POINT: %s\n"
-            "ERROR:       Script exceeded maximum allowed cycle count of %i",
+        ERR("ERROR with embryo script. "
+            "OBJECT NAME: '%s', "
+            "OBJECT FILE: '%s', "
+            "ENTRY POINT: '%s', "
+            "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
             em->edje->collection->part,
             em->edje->file->path,
             "message",
index 2b56cbe..3963926 100644 (file)
@@ -618,11 +618,11 @@ _call_fn(Edje * ed, const char *fname, Embryo_Function fn)
    ret = embryo_program_run(ed->collection->script, fn);
    if (ret == EMBRYO_PROGRAM_FAIL)
      {
-       ERR("ERROR with embryo script.\n"
-            "OBJECT NAME: %s\n"
-            "OBJECT FILE: %s\n"
-            "ENTRY POINT: %s\n"
-           "ERROR:       %s",
+       ERR("ERROR with embryo script. "
+            "OBJECT NAME: '%s', "
+            "OBJECT FILE: '%s', "
+            "ENTRY POINT: '%s', "
+           "ERROR: '%s'",
             ed->collection->part,
             ed->file->path,
             fname,
@@ -630,11 +630,11 @@ _call_fn(Edje * ed, const char *fname, Embryo_Function fn)
      }
    else if (ret == EMBRYO_PROGRAM_TOOLONG)
      {
-       ERR("ERROR with embryo script.\n"
-            "OBJECT NAME: %s\n"
-            "OBJECT FILE: %s\n"
-            "ENTRY POINT: %s\n"
-           "ERROR:       Script exceeded maximum allowed cycle count of %i",
+       ERR("ERROR with embryo script. "
+            "OBJECT NAME: '%s', "
+            "OBJECT FILE: '%s', "
+            "ENTRY POINT: '%s', "
+           "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
             ed->collection->part,
             ed->file->path,
             fname, 
index 7f3c1b2..d5c2cc9 100644 (file)
@@ -2929,11 +2929,13 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
          }
        if ((ed->w > 4000) || (ed->h > 4000))
          {
-            ERR("file %s, group %s has a non-fixed part. add fixed: 1 1; ???",
-                   ed->path, ed->group);
-            if (pep)
-              ERR("  Problem part is: %s", pep->part->name);
-            ERR("  Will recalc min size not allowing broken parts to affect the result.");
+             if (pep)
+               ERR("file %s, group %s has a non-fixed part '%s'. Adding 'fixed: 1 1;' to source EDC may help. Continuing discarding faulty part.",
+                   ed->path, ed->group, pep->part->name);
+             else
+               ERR("file %s, group %s overflowed 4000x4000 with minimum size of %dx%d. Continuing discarding faulty parts.",
+                   ed->path, ed->group, ed->w, ed->h);
+
             if (reset_maxwh)
               {
                  reset_maxwh = 0;
index 235d372..8175ed6 100644 (file)
@@ -33,20 +33,20 @@ _edje_var_timer_cb(void *data)
         ret = embryo_program_run(ed->collection->script, fn);
         if (ret == EMBRYO_PROGRAM_FAIL)
           {
-             ERR("ERROR with embryo script (timer callback).\n"
-                 "OBJECT NAME: %s\n"
-                 "OBJECT FILE: %s\n"
-                 "ERROR:       %s",
+             ERR("ERROR with embryo script (timer callback). "
+                 "OBJECT NAME: '%s', "
+                 "OBJECT FILE: '%s', "
+                 "ERROR: '%s'",
                  ed->collection->part,
                  ed->file->path,
                  embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
           }
         else if (ret == EMBRYO_PROGRAM_TOOLONG)
           {
-             ERR("ERROR with embryo script (timer callback).\n"
-                 "OBJECT NAME: %s\n"
-                 "OBJECT FILE: %s\n"
-                 "ERROR:       Script exceeded maximum allowed cycle count of %i",
+             ERR("ERROR with embryo script (timer callback). "
+                 "OBJECT NAME: '%s', "
+                 "OBJECT FILE: '%s', "
+                 "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
                  ed->collection->part,
                  ed->file->path,
                  embryo_program_max_cycle_run_get(ed->collection->script));
@@ -114,20 +114,20 @@ _edje_var_anim_cb(void *data __UNUSED__)
                             ret = embryo_program_run(ed->collection->script, fn);
                             if (ret == EMBRYO_PROGRAM_FAIL)
                               {
-                                 ERR("ERROR with embryo script (anim callback).\n"
-                                     "OBJECT NAME: %s\n"
-                                     "OBJECT FILE: %s\n"
-                                     "ERROR:       %s",
+                                 ERR("ERROR with embryo script (anim callback). "
+                                     "OBJECT NAME: '%s', "
+                                     "OBJECT FILE: '%s', "
+                                     "ERROR: '%s'",
                                      ed->collection->part,
                                      ed->file->path,
                                      embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
                               }
                             else if (ret == EMBRYO_PROGRAM_TOOLONG)
                               {
-                                 ERR("ERROR with embryo script (anim callback).\n"
-                                     "OBJECT NAME: %s\n"
-                                     "OBJECT FILE: %s\n"
-                                     "ERROR:       Script exceeded maximum allowed cycle count of %i",
+                                 ERR("ERROR with embryo script (anim callback). "
+                                     "OBJECT NAME: '%s', "
+                                     "OBJECT FILE: '%s', "
+                                     "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
                                      ed->collection->part,
                                      ed->file->path,
                                      embryo_program_max_cycle_run_get(ed->collection->script));