DOKK / manpages / debian 10 / liblog4c-doc / log4c_layout_get_name.3.en
layout.h(3) log4c layout.h(3)

layout.h -

Interface for user specific layout format of log4c_logging_event events.

#include <log4c/defs.h>
#include <log4c/logging_event.h>
#include <stdio.h>


struct log4c_layout_type
log4c layout type class


#define log4c_layout_type_define(a_type)


typedef struct __log4c_layout log4c_layout_t
typedef struct log4c_layout_type log4c_layout_type_t
log4c layout type class


LOG4C_API const log4c_layout_type_t * log4c_layout_type_get (const char *a_name)
LOG4C_API const log4c_layout_type_t * log4c_layout_type_set (const log4c_layout_type_t *a_type)
LOG4C_API log4c_layout_t * log4c_layout_get (const char *a_name)
LOG4C_API log4c_layout_t * log4c_layout_new (const char *a_name)
LOG4C_API void log4c_layout_delete (log4c_layout_t *a_layout)
LOG4C_API const char * log4c_layout_get_name (const log4c_layout_t *a_layout)
LOG4C_API const log4c_layout_type_t * log4c_layout_get_type (const log4c_layout_t *a_layout)
LOG4C_API const log4c_layout_type_t * log4c_layout_set_type (log4c_layout_t *a_layout, const log4c_layout_type_t *a_type)
LOG4C_API void * log4c_layout_get_udata (const log4c_layout_t *a_layout)
LOG4C_API void * log4c_layout_set_udata (log4c_layout_t *a_layout, void *a_udata)
LOG4C_API const char * log4c_layout_format (const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
LOG4C_API void log4c_layout_print (const log4c_layout_t *a_layout, FILE *a_stream)
LOG4C_API void log4c_layout_types_print (FILE *fp)

Interface for user specific layout format of log4c_logging_event events.

Todo

the layout interface needs a better configuration system depending on the layout type. The udata field is a just a trick.

Todo

a pattern layout would be welcomed !!

Parameters:

a_type the log4c_layout_type_t object to define

Warning:

needs GCC support: otherwise this macro does nothing

Deprecated

This macro, and the static initialialization of layouts in general, is deprecated. Use rather the log4c_layout_type_set() function to initialize your appenders before calling log4c_init()

log4c layout type class Attributes description:

  • name layout type name
  • format

Parameters:

a_layout the log4c_layout_t object
a_event a logging_event_t object

Returns:

an appendable string.

LOG4C_API log4c_layout_t* log4c_layout_get (const char *a_name) Get a pointer to an existing layout.

Parameters:

a_name the name of the layout to return.

Returns:

a pointer to an existing layout, or NULL if no layout with the specfied name exists.

a_layout the log4c_layout_t object

Returns:

the layout name

LOG4C_API const log4c_layout_type_t* log4c_layout_get_type (const log4c_layout_t *a_layout) Parameters:

a_layout the log4c_layout_t object

Returns:

a log4c_layout_type_t object

a_layout the log4c_layout_t object

Returns:

the layout user data

LOG4C_API log4c_layout_t* log4c_layout_new (const char *a_name) Constructor for layout.

Parameters:

a_layout the log4c_layout_t object
a_stream the stream

LOG4C_API const log4c_layout_type_t* log4c_layout_set_type (log4c_layout_t *a_layout, const log4c_layout_type_t *a_type) sets the layout type

Parameters:

a_layout the log4c_layout_t object
a_type the new layout type

Returns:

the previous layout type

Parameters:

a_layout the log4c_layout_t object
a_udata the new layout user data

Returns:

the previous layout user data

LOG4C_API const log4c_layout_type_t* log4c_layout_type_get (const char *a_name) Get a pointer to an existing layout type.

Parameters:

a_name the name of the layout type to return.

Returns:

a pointer to an existing layout type, or NULL if no layout type with the specified name exists.

LOG4C_API const log4c_layout_type_t* log4c_layout_type_set (const log4c_layout_type_t *a_type) Use this function to register a layout type with log4c. Once this is done you may refer to this type by name both programatically and in the log4c configuration file.

Parameters:

a_type a pointer to the new layout type to set.

Returns:

a pointer to the previous layout type of same name.

Example code fragment:


const log4c_layout_type_t log4c_layout_type_xml = {
's13_xml',
xml_format,
};

log4c_layout_type_set(&log4c_layout_type_xml);

Parameters:

fp the stream

Generated automatically by Doxygen for log4c from the source code.

Mon May 2 2011 Version 1.2.1