Logo Search packages:      
Sourcecode: log4c version File versions  Download package

LOG4C_API int log4c_category_get_chainedpriority ( const log4c_category_t a_category  ) 

Starting from this category, search the category hierarchy for a set priority and return it. Otherwise, return the priority of the root category.

Parameters:
a_category the log4c_category_t object
Todo:
the log4c_category_t is designed so that this method executes as quickly as possible. It could even be faster if the set priority was propagated through the children hierarchy of a category.

Definition at line 120 of file category.c.

References LOG4C_PRIORITY_NOTSET, and LOG4C_PRIORITY_UNKNOWN.

{
  const log4c_category_t* cat = this;
  
  if (!this) 
    return LOG4C_PRIORITY_UNKNOWN;
  
  while (cat->cat_priority == LOG4C_PRIORITY_NOTSET && cat->cat_parent)
    cat = cat->cat_parent;
      
  return cat->cat_priority;
}


Generated by  Doxygen 1.6.0   Back to index