On Wed, Sep 2, 2009 at 4:47 PM, Mathieu
Taillefumier<mathieu.taillefum...@free.fr> wrote:
> Hello,
>
> As my previous message said I think I understand the changes to do but
> to be sure i would like to try with one example of my own. For this I
> take the function eina_array_init() for the eina_array.c file.
>
> the original code is this one (minus uninteresting details for the
> discussion)
>
> EAPI int eina_array_init(void)
> {
>    if (!_eina_array_init_count)
>      {
>         if (!eina_error_init())
>           {
>              fprintf(stderr, "Could not initialize eina error module.\n");
>              return 0;
>           }
>
>         if (!eina_magic_string_init())
>           {
>              EINA_ERROR_PERR("ERROR: Could not initialize eina magic
> string modu
> le.\n");
>              eina_error_shutdown();
>              return 0;
>            }
>         /* */ do some stuff
>     }
>     return ;
> }
>
> the modified version is the following
>
> EAPI int eina_array_init(void)
> {
>    if (!_eina_array_init_count)
>      {
>         if (!eina_error_init())
>           {
>              fprintf(stderr, "Could not initialize eina error module.\n");
>              return 0;
>           }
>         if(!eina_log_init())
>           {
>              fprintf(stderr, "Could not initialize eina log module.\n");
>              return 0;
>           }
>          if (!eina_magic_string_init())
>           {
>              EINA_LOG_ERR(EINA_LOG_DOMAIN_GLOBAL, "ERROR: Could not
> initialize eina magic string module.\n");
>              eina_log_shutdown();
>              eina_error_shutdown();
>              return 0;
>            }
>         /* */ do some stuff
>     }
>     return ;
> }
>
> Now what is the difference between EINA_LOG_ERR and EINA_LOG_DOM_ERR in
> this case. Would it be wise to create an individual logging domain for
> each module or can we stick to the central logging domain defined in
> eina_log_init() function. Now in the following example, i can not delete
> the eina_error_init() function because some of the functions in the
> eina_array.c file use the eina_error_set function.

EINA_LOG_ERR() will assume EINA_LOG_DOMAIN_GLOBAL, so you're code is
not correct, you should either use EINA_LOG_ERR("bla") or
EINA_LOG_DOM_ERR(EINA_LOG_DOMAIN_GLOBAL, "bla").

We should have one domain per-submodule (or at least one domain
exclusive for eina), the more fine grained, the better to debug.


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
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

Reply via email to