2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_LOG4J_LOGGING_INTERNAL_H
9 #define LTTNG_EVENT_RULE_LOG4J_LOGGING_INTERNAL_H
11 #include <common/macros.hpp>
12 #include <common/optional.hpp>
13 #include <common/payload-view.hpp>
15 #include <lttng/event-rule/event-rule-internal.hpp>
16 #include <lttng/event-rule/log4j-logging.h>
17 #include <lttng/event.h>
18 #include <lttng/log-level-rule-internal.hpp>
20 #define LTTNG_LOG4J_EVENT_RULE_AT_LEAST_AS_SEVERE_AS_OP ">="
22 struct lttng_event_rule_log4j_logging {
23 struct lttng_event_rule parent;
29 char *filter_expression;
32 struct lttng_log_level_rule *log_level_rule;
34 /* internal use only. */
37 struct lttng_bytecode *bytecode;
41 struct lttng_event_rule_log4j_logging_comm {
42 /* Includes terminator `\0`. */
44 /* Includes terminator `\0`. */
45 uint32_t filter_expression_len;
46 /* enum lttng_log_level_rule_comm + payload if any */
47 uint32_t log_level_rule_len;
49 * Payload is composed of, in that order:
50 * - pattern (null terminated),
51 * - filter expression (null terminated),
52 * - log level rule serialized object,
57 ssize_t lttng_event_rule_log4j_logging_create_from_payload(struct lttng_payload_view *view,
58 struct lttng_event_rule **rule);
60 #endif /* LTTNG_EVENT_RULE_LOG4J_LOGGING_INTERNAL_H */