.TH "category.h" 3 "Mon May 2 2011" "Version 1.2.1" "log4c" \" -*- nroff -*- .ad l .nh .SH NAME category.h \- .PP central class in the log4c package. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Defines" .in +1c .ti -1c .RI "#define \fBlog4c_category_define\fP(a_category, a_name)" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct __log4c_category \fBlog4c_category_t\fP" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "LOG4C_API \fBlog4c_category_t\fP * \fBlog4c_category_get\fP (const char *a_name)" .br .ti -1c .RI "LOG4C_API int \fBlog4c_category_list\fP (\fBlog4c_category_t\fP **a_cats, int a_ncats)" .br .ti -1c .RI "LOG4C_API \fBlog4c_category_t\fP * \fBlog4c_category_new\fP (const char *a_name)" .br .ti -1c .RI "LOG4C_API void \fBlog4c_category_delete\fP (\fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "LOG4C_API const char * \fBlog4c_category_get_name\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "LOG4C_API struct __log4c_appender * \fBlog4c_category_get_appender\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "LOG4C_API int \fBlog4c_category_get_additivity\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "LOG4C_API int \fBlog4c_category_get_priority\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "LOG4C_API int \fBlog4c_category_get_chainedpriority\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "LOG4C_API struct __log4c_appender * \fBlog4c_category_set_appender\fP (\fBlog4c_category_t\fP *a_category, struct __log4c_appender *a_appender)" .br .ti -1c .RI "LOG4C_API int \fBlog4c_category_set_priority\fP (\fBlog4c_category_t\fP *a_category, int a_priority)" .br .ti -1c .RI "LOG4C_API int \fBlog4c_category_set_additivity\fP (\fBlog4c_category_t\fP *a_category, int a_additivity)" .br .ti -1c .RI "LOG4C_API void \fBlog4c_category_print\fP (const \fBlog4c_category_t\fP *a_category, FILE *a_stream)" .br .ti -1c .RI "static int \fBlog4c_category_is_priority_enabled\fP (const \fBlog4c_category_t\fP *a_category, int a_priority)" .br .ti -1c .RI "static int \fBlog4c_category_is_fatal_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_alert_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_crit_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_error_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_warn_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_notice_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_info_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_debug_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static int \fBlog4c_category_is_trace_enabled\fP (const \fBlog4c_category_t\fP *a_category)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_log\fP (const \fBlog4c_category_t\fP *a_category, int a_priority, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_log_locinfo\fP (const \fBlog4c_category_t\fP *a_category, const \fBlog4c_location_info_t\fP *a_locinfo, int a_priority, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_fatal\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_alert\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_crit\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_error\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_warn\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_notice\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_info\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fBlog4c_category_debug\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .ti -1c .RI "static LOG4C_INLINE void \fB__log4c_category_trace\fP (const \fBlog4c_category_t\fP *a_category, const char *a_format,...)" .br .in -1c .SH "Detailed Description" .PP central class in the log4c package. One of the distintive features of log4j (and hence log4c) are hierarchical categories and their evaluation. .SH "Define Documentation" .PP .SS "#define log4c_category_define(a_category, a_name)"Helper macro to define static categories. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t pointer name .br \fIa_name\fP the category name .RE .PP .SH "Typedef Documentation" .PP .SS "typedef struct __log4c_category \fBlog4c_category_t\fP"log4c category class .SH "Function Documentation" .PP .SS "static LOG4C_INLINE void __log4c_category_trace (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with trace priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_TRACE. .SS "static LOG4C_INLINE void log4c_category_alert (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with alert priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ALERT. .SS "static LOG4C_INLINE void log4c_category_crit (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with crit priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_CRIT. .SS "static LOG4C_INLINE void log4c_category_debug (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with debug priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_DEBUG. .SS "LOG4C_API void log4c_category_delete (\fBlog4c_category_t\fP *a_category)"Destructor for a log4c_category_t. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP .SS "static LOG4C_INLINE void log4c_category_error (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with error priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ERROR. .SS "static LOG4C_INLINE void log4c_category_fatal (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with fatal priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_FATAL. .SS "LOG4C_API \fBlog4c_category_t\fP* log4c_category_get (const char *a_name)"Instantiate a log4c_category_t with name \fIname\fP. This method does not set priority of the category which is by default \fCLOG4C_PRIORITY_NOTSET\fP. .PP \fBParameters:\fP .RS 4 \fIa_name\fP The name of the category to retrieve. .RE .PP \fBBug\fP .RS 4 the root category name should be '' not 'root'. * .RE .PP .SS "LOG4C_API int log4c_category_get_additivity (const \fBlog4c_category_t\fP *a_category)"Get the additivity flag for this log4c_category_t.. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 the category additivity .RE .PP .SS "LOG4C_API struct __log4c_appender* log4c_category_get_appender (const \fBlog4c_category_t\fP *a_category)\fC [read]\fP"Returns the Appender for this log4c_category_t, or NULL if no Appender has been set. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 The Appender. .RE .PP .SS "LOG4C_API int log4c_category_get_chainedpriority (const \fBlog4c_category_t\fP *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. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBTodo\fP .RS 4 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. .RE .PP .PP References LOG4C_PRIORITY_NOTSET, and LOG4C_PRIORITY_UNKNOWN. .SS "LOG4C_API const char* log4c_category_get_name (const \fBlog4c_category_t\fP *a_category)"Return the category name. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 the category name. .RE .PP .SS "LOG4C_API int log4c_category_get_priority (const \fBlog4c_category_t\fP *a_category)"Returns the assigned Priority, if any, for this log4c_category_t. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Priority - the assigned Priority, can be LOG4C_PRIORITY_NOTSET .RE .PP .PP References LOG4C_PRIORITY_UNKNOWN. .SS "static LOG4C_INLINE void log4c_category_info (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with info priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_INFO. .SS "static int log4c_category_is_alert_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_ALERT\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ALERT. .SS "static int log4c_category_is_crit_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_CRIT\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_CRIT. .SS "static int log4c_category_is_debug_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_DEBUG\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_DEBUG. .SS "static int log4c_category_is_error_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_ERROR\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_ERROR. .SS "static int log4c_category_is_fatal_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_FATAL\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_FATAL. .SS "static int log4c_category_is_info_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_INFO\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_INFO. .SS "static int log4c_category_is_notice_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_NOTICE\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_NOTICE. .SS "static int log4c_category_is_priority_enabled (const \fBlog4c_category_t\fP *a_category, inta_priority)\fC [inline, static]\fP"Returns true if the chained priority of the log4c_category_t is equal to or higher than given priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_priority\fP The priority to compare with. .RE .PP \fBReturns:\fP .RS 4 whether logging is enable for this priority. .RE .PP .SS "static int log4c_category_is_trace_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_TRACE\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_TRACE. .SS "static int log4c_category_is_warn_enabled (const \fBlog4c_category_t\fP *a_category)\fC [inline, static]\fP"Return true if the category will log messages with priority \fCLOG4C_PRIORITY_WARN\fP. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .RE .PP \fBReturns:\fP .RS 4 Whether the category will log. .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_WARN. .SS "LOG4C_API int log4c_category_list (\fBlog4c_category_t\fP **a_cats, inta_ncats)"Fill in an array with the log4c categories. .PP \fBParameters:\fP .RS 4 \fIa_cats\fP array of categories that will be filled .br \fIa_ncats\fP number of categories in the array .RE .PP \fBReturns:\fP .RS 4 -1 if it fails or the number of available categories in log4c. .RE .PP .SS "static LOG4C_INLINE void log4c_category_log (const \fBlog4c_category_t\fP *a_category, inta_priority, const char *a_format, ...)\fC [static]\fP"Log a message with the specified priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_priority\fP The priority of this log message. .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(). .SS "static LOG4C_INLINE void log4c_category_log_locinfo (const \fBlog4c_category_t\fP *a_category, const \fBlog4c_location_info_t\fP *a_locinfo, inta_priority, const char *a_format, ...)\fC [static]\fP"Log a message with the specified priority and a user location info. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_locinfo\fP a user location info .br \fIa_priority\fP The priority of this log message. .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(). .SS "LOG4C_API \fBlog4c_category_t\fP* log4c_category_new (const char *a_name)"Constructor for a log4c_category_t. .PP \fBParameters:\fP .RS 4 \fIa_name\fP the category name .RE .PP \fBReturns:\fP .RS 4 a log4c_category object .RE .PP \fBWarning:\fP .RS 4 this method should not be called directly. You should use the \fBlog4c_category_get()\fP method in order to preserve the categories hierarchy. .RE .PP .PP References LOG4C_PRIORITY_NOTSET. .SS "static LOG4C_INLINE void log4c_category_notice (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with notice priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_NOTICE. .SS "LOG4C_API void log4c_category_print (const \fBlog4c_category_t\fP *a_category, FILE *a_stream)"prints the log4c_category_t object on a stream .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_stream\fP The stream .RE .PP .SS "LOG4C_API int log4c_category_set_additivity (\fBlog4c_category_t\fP *a_category, inta_additivity)"Sets a new additivity flag for this category. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_additivity\fP the new category additivity .RE .PP \fBReturns:\fP .RS 4 the previous category additivity .RE .PP .SS "LOG4C_API struct __log4c_appender* log4c_category_set_appender (\fBlog4c_category_t\fP *this, \fBlog4c_appender_t\fP *a_appender)\fC [read]\fP"Sets a new appender for this category. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_appender\fP the new category appender .RE .PP \fBReturns:\fP .RS 4 the previous category appender .RE .PP \fBTodo\fP .RS 4 need multiple appenders per category .RE .PP .SS "LOG4C_API int log4c_category_set_priority (\fBlog4c_category_t\fP *a_category, inta_priority)"Sets a new priority of this category. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_priority\fP the new priority to set. Use LOG4C_PRIORITY_NOTSET to let the category use its parents priority as effective priority. .RE .PP \fBReturns:\fP .RS 4 the previous category priority .RE .PP .PP References LOG4C_PRIORITY_UNKNOWN. .SS "static LOG4C_INLINE void log4c_category_warn (const \fBlog4c_category_t\fP *a_category, const char *a_format, ...)\fC [static]\fP"Log a message with warn priority. .PP \fBParameters:\fP .RS 4 \fIa_category\fP the log4c_category_t object .br \fIa_format\fP Format specifier for the string to write in the log file. .br \fI...\fP The arguments for a_format .RE .PP .PP References log4c_category_is_priority_enabled(), and LOG4C_PRIORITY_WARN. .SH "Author" .PP Generated automatically by Doxygen for log4c from the source code.