![]() |
LTTng control library C API
|

Functions | |
| struct lttng_event_rule * | lttng_event_rule_python_logging_create (void) |
| Creates a default Python logging event rule. | |
| enum lttng_event_rule_status | lttng_event_rule_python_logging_get_filter (const struct lttng_event_rule *rule, const char **filter_expr) |
Sets *filter_expr to the event payload and context filter expression of the Python logging event rule rule. | |
| enum lttng_event_rule_status | lttng_event_rule_python_logging_get_log_level_rule (const struct lttng_event_rule *event_rule, const struct lttng_log_level_rule **log_level_rule) |
Sets *log_level_rule to the instrumentation point log level rule of the Python logging event rule event_rule. | |
| enum lttng_event_rule_status | lttng_event_rule_python_logging_get_name_pattern (const struct lttng_event_rule *rule, const char **pattern) |
Sets *pattern to the event name pattern of the Python logging event rule rule. | |
| enum lttng_event_rule_status | lttng_event_rule_python_logging_set_filter (struct lttng_event_rule *rule, const char *filter_expr) |
Sets the event payload and context filter of the Python logging event rule rule to filter_expr. | |
| enum lttng_event_rule_status | lttng_event_rule_python_logging_set_log_level_rule (struct lttng_event_rule *event_rule, const struct lttng_log_level_rule *log_level_rule) |
Sets the instrumentation point log level rule of the Python logging event rule event_rule to log_level_rule. | |
| enum lttng_event_rule_status | lttng_event_rule_python_logging_set_name_pattern (struct lttng_event_rule *rule, const char *pattern) |
Sets the event name pattern of the Python logging event rule rule to pattern. | |
A Python logging event rule is an event rule with the LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING type.
logging is a standard Python module that provides a flexible framework for emitting log messages from applications. It supports different severity levels, configurable formatting, and routing through handlers such as console and file output. The LTTng-UST project provides a Python logging handler which creates an LTTng event from an emitted Python logging statement.
Create a Python logging event rule with lttng_event_rule_python_logging_create().
The specific event rule conditions accessors of a Python logging event rule are:
|
extern |
Creates a default Python logging event rule.
On success, the returned event rule has the following initial conditions:
| Condition | Value | Setter |
|---|---|---|
| Instrumentation point type | LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING | Not applicable |
| Event name | Any name | lttng_event_rule_python_logging_set_name_pattern() |
| Instrumentation point log level | Any log level | lttng_event_rule_python_logging_set_log_level_rule() |
| Event payload and context filter | No filter | lttng_event_rule_python_logging_set_filter() |
Python logging event rule on success, or NULL on error.
Destroy the returned event rule with lttng_event_rule_destroy().
|
extern |
Sets *filter_expr to the event payload and context filter expression of the Python logging event rule rule.
See the event payload and context filter condition.
| [in] | rule | Python logging event rule of which to get the event payload and context filter. |
| [out] | filter_expr | On success, this function sets
|
| LTTNG_EVENT_RULE_STATUS_OK | Success. |
| LTTNG_EVENT_RULE_STATUS_UNSET | rule has no event payload and context filter, which corresponds to the filter expression 1. |
| LTTNG_EVENT_RULE_STATUS_INVALID | Unsatisfied precondition. |
rule is not NULL.rule has the type LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING.expression is not NULL.
|
extern |
Sets *log_level_rule to the instrumentation point log level rule of the Python logging event rule event_rule.
See the instrumentation point log level condition.
| [in] | event_rule | Python logging event rule of which to get the log level rule. |
| [out] | log_level_rule | On success, this function sets
|
| LTTNG_EVENT_RULE_STATUS_OK | Success. |
| LTTNG_EVENT_RULE_STATUS_UNSET | event_rule has no log level rule. |
| LTTNG_EVENT_RULE_STATUS_INVALID | Unsatisfied precondition. |
event_rule is not NULL.event_rule has the type LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING.log_level_rule is not NULL.
|
extern |
Sets *pattern to the event name pattern of the Python logging event rule rule.
See the event name condition.
| [in] | rule | Python logging event rule of which to get the event name pattern. |
| [out] | pattern | On success, this function sets
|
| LTTNG_EVENT_RULE_STATUS_OK | Success. |
| LTTNG_EVENT_RULE_STATUS_UNSET | rule has no event name pattern, which corresponds to the pattern * (any event name). |
| LTTNG_EVENT_RULE_STATUS_INVALID | Unsatisfied precondition. |
rule is not NULL.rule has the type LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING.pattern is not NULL.
|
extern |
Sets the event payload and context filter of the Python logging event rule rule to filter_expr.
See the event payload and context filter condition.
| [in] | rule | Python logging event rule of which to set the filter. |
| [in] | filter_expr | Event payload and context filter expression of rule (copied). |
| LTTNG_EVENT_RULE_STATUS_OK | Success. |
| LTTNG_EVENT_RULE_STATUS_INVALID | Unsatisfied precondition. |
rule is not NULL.rule has the type LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING.filter_expr is not NULL.filter_expr is a valid filter expression (see the event payload and context filter condition).
|
extern |
Sets the instrumentation point log level rule of the Python logging event rule event_rule to log_level_rule.
See the instrumentation point log level condition.
| [in] | event_rule | Python logging event rule of which to set the log level rule. |
| [in] | log_level_rule | Log level rule of event_rule (copied). |
| LTTNG_EVENT_RULE_STATUS_OK | Success. |
| LTTNG_EVENT_RULE_STATUS_INVALID | Unsatisfied precondition. |
event_rule is not NULL.event_rule has the type LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING.log_level_rule is not NULL.
|
extern |
Sets the event name pattern of the Python logging event rule rule to pattern.
See the event name condition.
| [in] | rule | Python logging event rule of which to set the event name pattern. |
| [in] | pattern | New event name pattern of rule (copied). |
| LTTNG_EVENT_RULE_STATUS_OK | Success. |
| LTTNG_EVENT_RULE_STATUS_INVALID | Unsatisfied precondition. |
rule is not NULL.rule has the type LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING.pattern is not NULL.pattern is not empty.