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

LOG4C_API log4c_category_t* log4c_category_new ( const char *  a_name  ) 

Constructor for a log4c_category_t.

Parameters:
a_name the category name
Returns:
a log4c_category object
Warning:
this method should not be called directly. You should use the log4c_category_get() method in order to preserve the categories hierarchy.

Definition at line 73 of file category.c.

References LOG4C_PRIORITY_NOTSET.

{
  log4c_category_t* this;
  
  if (!a_name)
    return NULL;
  
  this            = sd_calloc(1, sizeof(log4c_category_t));
  this->cat_name  = sd_strdup(a_name);
  this->cat_priority    = LOG4C_PRIORITY_NOTSET;
  this->cat_additive    = 1;
  this->cat_appender    = NULL;
  this->cat_parent      = NULL;
  
  /* skip root category because it has a NULL parent */
  if (strcmp(LOG4C_CATEGORY_DEFAULT, a_name)) {
    char* tmp = sd_strdup(this->cat_name);
    
    this->cat_parent = log4c_category_get(dot_dirname(tmp));
    free(tmp);
  }
  return this;
}


Generated by  Doxygen 1.6.0   Back to index