[Openais] Logging patch.

Steven Dake sdake at mvista.com
Thu Oct 28 14:12:18 PDT 2004


On Thu, 2004-10-28 at 13:00, Daniel Stodden wrote:
> On Thu, 2004-10-28 at 10:28 -0700, Steven Dake wrote:
> > Daniel
> > 
> > Separate functions for each log level seem like a good idea to me.  I'm
> > not sure how the stack is different for the changes you have made (was
> > it va_start/va_end that was causing the problem?), but the changes look
> > fine to me.
> > 
> > Could you fix a few things though?
> > 
> > 1. ais_error should be ais_log_error.  Same for the other functions.
> 
> btw, does this mean the coding style issue has been finally resolved?
> 
> so we got <namespace>_<type>_<function>() conventions? gooood :)
> 
> i suppose this implies macro names as well, i.e
> s/LOG_SERVICE_CLM/AIS_LOG_SERVICE_CLM/ ?
> 
> that would make the whole thing much more readable in the long term.
> 
> 

Daniel,

You'd be surprised but there isn't too much discussion about coding
style yet.  The linux kernel coding style for the executive seems ok
although alot of the code doesn't specifically follow it.  For the
library, I'd prefer to follow the SA forum coding style so that people
can easily debug into libraries if needed and have consistent style with
the APIs down to the ipc layer.  When we started, we used sa forum for
the executive coding style but it really sucks and I don't like it.  I'd
like to rename the affected functions but its pretty low priority for
now.

For functions that are globally visible, I prefer
namespace_object_verbaction.  For functions that are local, I prefer
object_verb.  The same should be for definitions, but no real work has
gone into making this happen after the initial work.  I'd like all
message handlers used in services and structures used to communicate
between library and executive to have the same coding style, whatever it
may be.  I'm not 100% pleased with the current style (its a bit long)
but it gets the idea across about what sort of function to look at.  

In the case of logging log is both an object and verbaction.  When the
object and verb action match, object should be dropped.  In this
example, the object "log" is dropped and the verb is "log_warning".

There is alot of code that doesn't follow these convetions though so be
wary.  Parallel style is very important (more important then the
particular style chosen).  If we can stick with parallel styles then we
should atleast know how to read the code later on.  At some point we
need to do a style scrub probably after this initial release.

Thanks
-steve


> i suppose there's a mail about coding style i've missed. could you point
> me to a reference?
> 
> regards,
> daniel
> 
> ______________________________________________________________________
> _______________________________________________
> Openais mailing list
> Openais at lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/openais




More information about the Openais mailing list