Log4g Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#define LOG4G_LAYOUT_LINE_SEP Log4gLayout; Log4gLayoutClass; gchar * log4g_layout_format (Log4gLayout *self
,Log4gLoggingEvent *event
); const gchar * log4g_layout_get_content_type (Log4gLayout *self
); const gchar * log4g_layout_get_header (Log4gLayout *self
); const gchar * log4g_layout_get_footer (Log4gLayout *self
); void log4g_layout_activate_options (Log4gLayout *self
); gchar (*Log4gLayoutFormat) (Log4gLayout *self
,Log4gLoggingEvent *event
); const gchar (*Log4gLayoutGetContentType) (Log4gLayout *self
); const gchar (*Log4gLayoutGetHeader) (Log4gLayout *self
); const gchar (*Log4gLayoutGetFooter) (Log4gLayout *self
); void (*Log4gLayoutActivateOptions) (Log4gLayout *self
);
Users may extend this class to implement custom log event layouts.
Many appenders require a layout in order to log an event. Sub-classes
must override the _Log4gLayoutClass::format()
virtual function to implement
custom formatting.
typedef struct { } Log4gLayout;
The Log4gLayout structure does not have any public members.
typedef struct { Log4gLayoutFormat format; Log4gLayoutGetContentType get_content_type; Log4gLayoutGetHeader get_header; Log4gLayoutGetFooter get_footer; Log4gLayoutActivateOptions activate_options; } Log4gLayoutClass;
Log4gLayoutFormat |
Implement this function to create your own layout format. |
Log4gLayoutGetContentType |
Retrieve the content type output by this layout. |
Log4gLayoutGetHeader |
Retrieve the header for this layout. |
Log4gLayoutGetFooter |
Retrieve the footer for this layout. |
Log4gLayoutActivateOptions |
Activate all options set for this layout. |
gchar * log4g_layout_format (Log4gLayout *self
,Log4gLoggingEvent *event
);
Calls the format
function from the Log4gLayoutClass of self
.
|
A layout object. |
|
A logging event object to be laid out. |
Returns : |
The formatted logging event. |
Since 0.1
const gchar * log4g_layout_get_content_type (Log4gLayout *self
);
Calls the get_content_type
function from the Log4gLayoutClass of self
.
|
A layout object. |
Returns : |
The layout content type. |
Since 0.1
const gchar * log4g_layout_get_header (Log4gLayout *self
);
Calls the get_header
function from the Log4gLayoutClass of self
.
|
A layout object. |
Returns : |
The layout header. |
Since 0.1
const gchar * log4g_layout_get_footer (Log4gLayout *self
);
Calls the get_footer
function from the Log4gLayoutClass of self
.
|
A layout object. |
Returns : |
The layout footer. |
Since 0.1
void log4g_layout_activate_options (Log4gLayout *self
);
Calls the activate_options
function from the Log4gLayoutClass of self
.
Layouts generally need to have their options activated before they can be used. This class provides a do-nothing implementation for convenience.
|
A layout object. |
Since 0.1
gchar (*Log4gLayoutFormat) (Log4gLayout *self
,Log4gLoggingEvent *event
);
Implement this function to create your own layout format.
|
A layout object. |
|
A logging event object to be laid out. |
Returns : |
The formatted logging event. |
Since 0.1
const gchar (*Log4gLayoutGetContentType) (Log4gLayout *self
);
Retrieve the content type output by this layout.
The base class returns "text/plain".
|
A layout object. |
Returns : |
The layout content type. |
Since 0.1
const gchar (*Log4gLayoutGetHeader) (Log4gLayout *self
);
Retrieve the header for the layout format.
The base class returns \e NULL.
|
A layout object. |
Returns : |
The layout header. |
Since 0.1
const gchar (*Log4gLayoutGetFooter) (Log4gLayout *self
);
Retrieve the footer for the layout format.
The base class returns \e NULL.
|
A layout object. |
Returns : |
The layout footer. |
Since 0.1
void (*Log4gLayoutActivateOptions) (Log4gLayout *self
);
Activate all options set for this layout.
|
An layout object. |
Since 0.1