2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_PYTHON_LOGGING_H
9 #define LTTNG_EVENT_RULE_PYTHON_LOGGING_H
11 #include <lttng/event-rule/event-rule.h>
12 #include <lttng/event.h>
13 #include <lttng/log-level-rule.h>
14 #include <lttng/lttng-export.h>
21 * Create a newly allocated python logging event rule.
23 * The default name pattern is '*'.
25 * Returns a new event rule on success, NULL on failure. This event rule must be
26 * destroyed using lttng_event_rule_destroy().
28 LTTNG_EXPORT
extern struct lttng_event_rule
*lttng_event_rule_python_logging_create(void);
31 * Set the name pattern of a python logging event rule.
33 * Pattern can contain wildcard '*'. See man lttng-enable-event.
35 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
36 * if invalid parameters are passed.
38 LTTNG_EXPORT
extern enum lttng_event_rule_status
39 lttng_event_rule_python_logging_set_name_pattern(struct lttng_event_rule
*rule
,
43 * Get the name pattern of a python logging event rule.
45 * The caller does not assume the ownership of the returned pattern. The
46 * pattern shall only only be used for the duration of the event rule's
47 * lifetime, or before a different pattern is set.
49 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
50 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
51 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
52 * was not set prior to this call.
54 LTTNG_EXPORT
extern enum lttng_event_rule_status
55 lttng_event_rule_python_logging_get_name_pattern(const struct lttng_event_rule
*rule
,
56 const char **pattern
);
59 * Set the filter expression of a python logging event rule.
61 * The expression is copied internally.
63 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
64 * if invalid parameters are passed.
66 LTTNG_EXPORT
extern enum lttng_event_rule_status
67 lttng_event_rule_python_logging_set_filter(struct lttng_event_rule
*rule
, const char *expression
);
70 * Get the filter expression of a python logging event rule.
72 * The caller does not assume the ownership of the returned filter expression.
73 * The filter expression shall only only be used for the duration of the event
74 * rule's lifetime, or before a different filter expression is set.
76 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
77 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
78 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
79 * was not set prior to this call.
81 LTTNG_EXPORT
extern enum lttng_event_rule_status
82 lttng_event_rule_python_logging_get_filter(const struct lttng_event_rule
*rule
,
83 const char **expression
);
86 * Set the log level rule of a python logging event rule.
88 * The log level rule is copied internally.
90 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
91 * if invalid parameters are passed.
93 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_python_logging_set_log_level_rule(
94 struct lttng_event_rule
*rule
, const struct lttng_log_level_rule
*log_level_rule
);
97 * Get the log level rule of a python logging event rule.
99 * The caller does not assume the ownership of the returned log level rule. The
100 * log level rule shall only only be used for the duration of the event rule's
101 * lifetime, or before a different log level rule is set.
103 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level rule output
104 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
105 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
108 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_python_logging_get_log_level_rule(
109 const struct lttng_event_rule
*rule
, const struct lttng_log_level_rule
**log_level_rule
);
115 #endif /* LTTNG_EVENT_RULE_PYTHON_LOGGING_H */
This page took 0.033477 seconds and 4 git commands to generate.