On Tue, Mar 11, 2014 at 3:07 PM, Gustavo Sverzut Barbieri <barbi...@gmail.com> wrote: >
Hello Gustavo, > On Tue, Mar 11, 2014 at 9:02 AM, Felipe Magno de Almeida > <felipe.m.alme...@gmail.com> wrote: [snip] >> That is possible, we can change the name though to something unlikely >> to clash. > > I mean if you call the macro 3 times, one in the main function, > another inside "if()". Then in C it would declare the variable with > the same name 2 times, that will warn that the inner block > (if-statement) shadows the one in function scope. Yeah, that doesn't happen in C++ though. So there wouldn't be that problem. In C++ the variable defined in a for-loop lives only in the for-loop scope and is destroyed when the loop ends. [snip] >> OK. So let me know if this is really what you want: >> >> EINA_LOG(err) << "error " << error_code; >> EINA_LOG(dbg) << "error " << error_code; >> EINA_LOG(crit) << "error " << error_code; >> >> efl::eina::log_domain my_domain("mylib", "yellow"); >> EINA_LOG(my_domain.err) << "error " << error_code; >> EINA_LOG(my_domain.dbg) << "error " << error_code; >> EINA_LOG(my_domain.crit) << "error " << error_code; > > exactly what I want! > > I liked the idea of using "endl" to flush, allowing multiple on single > statement such as: > EINA_LOG(crit) << "error " << error_code << endl << "another line" << endl; > > but that's minor. I like the way you have it now. Ok. >> Is the EINA_LOG(err) going to log on the default domain or the global domain? >> If it is this that you want I think this is doable. If not, let me >> know where is my >> misunderstanding. > > that's it. EINA_LOG(err) logs to err... whatever err is. If the guy > says "using namespace efl::eina::log", then it's the global log > domain. If he does a global variable on his project called "err", then > he is using his own log domain. That is more complicated, also I dislike using namespace in headers for obvious reasons. What is easy is to just log to EINA_LOG_DOMAIN_DEFAULT and have the user #define it as already is for C. Give me sometime to think. > -- > Gustavo Sverzut Barbieri > -------------------------------------- > Mobile: +55 (19) 99225-2202 > Contact: http://www.gustavobarbieri.com.br/contact Regards, -- Felipe Magno de Almeida ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel