Log4g Reference Manual | ||||
---|---|---|---|---|
Top | Description |
Log4gLoggingEvent; Log4gLoggingEventClass; Log4gLoggingEvent * log4g_logging_event_new (const gchar *logger
,Log4gLevel *level
,const gchar *function
,const gchar *file
,const gchar *line
,const gchar *message
,va_list ap
); Log4gLevel * log4g_logging_event_get_level (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_logger_name (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_rendered_message (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_message (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_mdc (Log4gLoggingEvent *self
,const gchar *key
); GTimeVal * log4g_logging_event_get_time_stamp (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_thread_name (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_ndc (Log4gLoggingEvent *self
); const GArray * log4g_logging_event_get_property_key_set (Log4gLoggingEvent *self
); void log4g_logging_event_get_thread_copy (Log4gLoggingEvent *self
); void log4g_logging_event_get_mdc_copy (Log4gLoggingEvent *self
); void log4g_logging_event_get_ndc_copy (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_function_name (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_file_name (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_line_number (Log4gLoggingEvent *self
); const gchar * log4g_logging_event_get_full_info (Log4gLoggingEvent *self
); glong log4g_logging_event_get_start_time (void
); Log4gLevel (*Log4gLoggingEventGetLevel) (Log4gLoggingEvent *self
);
Once an affirmative decision is made to log an event a logging event instance is created. This instance is passed to appenders and filters to perform actual logging.
This class is only useful to those wishing to extend Log4g.
typedef struct { } Log4gLoggingEvent;
The Log4gLoggingEvent structure does not have any public members.
typedef struct { Log4gLoggingEventGetLevel get_level; } Log4gLoggingEventClass;
Log4gLoggingEventGetLevel |
Retrieve the log level of a logging event. |
Log4gLoggingEvent * log4g_logging_event_new (const gchar *logger
,Log4gLevel *level
,const gchar *function
,const gchar *file
,const gchar *line
,const gchar *message
,va_list ap
);
Create a new logging event.
|
The name of the logger that is creating this event. |
|
The log level of this event. |
|
The function where this event was logged. |
|
The file where this event was logged. |
|
The line in file where this event was logged.
|
|
A printf formatted log message. |
|
Format parameters. |
Returns : |
A new logging event object. |
Since 0.1
Log4gLevel * log4g_logging_event_get_level (Log4gLoggingEvent *self
);
Calls the get_level
function from the Log4gLoggingEventClass of self
.
|
A logging event object. |
Returns : |
The log level of self .
|
Since 0.1
const gchar * log4g_logging_event_get_logger_name (Log4gLoggingEvent *self
);
Retrieve the name of the logger that created a logging event.
|
A logging event object. |
Returns : |
The name of the logger that created self .
|
Since 0.1
const gchar * log4g_logging_event_get_rendered_message
(Log4gLoggingEvent *self
);
Retrieve the rendered logging message.
See
: log4g_logging_event_get_message()
|
A logging event object. |
Returns : |
The rendered logging message. |
Since 0.1
const gchar * log4g_logging_event_get_message (Log4gLoggingEvent *self
);
Retrieve the log message.
This function is equivalent to log4g_logging_event_get_rendered_message()
.
|
A logging event object. |
Returns : |
The log message. |
Since 0.1
const gchar * log4g_logging_event_get_mdc (Log4gLoggingEvent *self
,const gchar *key
);
Retrieve a mapped data context value for a logging event.
See
: Log4gMDC
|
A logging event object. |
|
A mapped data context key. |
Returns : |
The MDC value for key .
|
Since 0.1
GTimeVal * log4g_logging_event_get_time_stamp (Log4gLoggingEvent *self
);
Retrieve the timestamp of a logging event.
|
A logging event object. |
Returns : |
The timestamp of self .
|
Since 0.1
const gchar * log4g_logging_event_get_thread_name (Log4gLoggingEvent *self
);
Retrieve the name of the thread where a logging event was logged.
|
A logging event object. |
Returns : |
The name of the thread where self was logged.
|
Since 0.1
const gchar * log4g_logging_event_get_ndc (Log4gLoggingEvent *self
);
Retrieve the nested data context for a logging event.
See
: Log4gNDC
|
A logging event object. |
Returns : |
The rendered NDC string for self .
|
Since 0.1
const GArray * log4g_logging_event_get_property_key_set
(Log4gLoggingEvent *self
);
Get the MDC keys (if any) for this event.
See
: Log4gMDC
|
A logging event object. |
Returns : |
An array of keys, or NULL if no keys exist.
|
Since 0.1
void log4g_logging_event_get_thread_copy (Log4gLoggingEvent *self
);
Copy the current thread name into a logging object.
Asynchronous appenders should call this function.
See
: Log4gThreadClass
|
A logging event object. |
void log4g_logging_event_get_mdc_copy (Log4gLoggingEvent *self
);
Copy the current mapped data context into a logging event.
Asynchronous appenders should call this function.
See
Log4gMDC
|
A logging event object. |
Since 0.1
void log4g_logging_event_get_ndc_copy (Log4gLoggingEvent *self
);
Copy the current nested data context into a logging event.
Asynchronous appenders should call this function.
See
Log4gNDC
|
A logging event object. |
Since 0.1
const gchar * log4g_logging_event_get_function_name
(Log4gLoggingEvent *self
);
Retrieve the function where a logging event was logged.
|
A logging event object. |
Returns : |
The function where self was logged.
|
Since 0.1
const gchar * log4g_logging_event_get_file_name (Log4gLoggingEvent *self
);
Retrieve the file where a logging event was logged.
|
A logging event object. |
Returns : |
The file where self was logged.
|
Since 0.1
const gchar * log4g_logging_event_get_line_number (Log4gLoggingEvent *self
);
Retrieve the line number where a logging event was logged.
|
A logging event object. |
Returns : |
The line number where self was logged.
|
Since 0.1
const gchar * log4g_logging_event_get_full_info (Log4gLoggingEvent *self
);
Retrieve the full location information where a logging event was logged.
The full location information is in the format:
function(file:line)
|
A logging event object. |
Returns : |
The full log location information for self .
|
Since 0.1
glong log4g_logging_event_get_start_time (void
);
Retrieve the time when the log system was initialized.
Returns : |
The number of seconds elapsed since the Unix epoch when the log system was initialized |
Since 0.1
Log4gLevel (*Log4gLoggingEventGetLevel) (Log4gLoggingEvent *self
);
Retrieve the log level of a logging event.
See
: log4g/level.h
|
A logging event object. |
Returns : |
The log level of self .
|
Since 0.1