LTTng control library C API
Loading...
Searching...
No Matches
Collaboration diagram for Log level rule API:

Data Structures

struct  lttng_log_level_rule
 Log level rule (opaque type). More...
 

Enumerations

enum  lttng_log_level_rule_status { LTTNG_LOG_LEVEL_RULE_STATUS_OK , LTTNG_LOG_LEVEL_RULE_STATUS_ERROR , LTTNG_LOG_LEVEL_RULE_STATUS_INVALID }
 Return type of log level rule API functions. More...
 
enum  lttng_log_level_rule_type { LTTNG_LOG_LEVEL_RULE_TYPE_EXACTLY , LTTNG_LOG_LEVEL_RULE_TYPE_AT_LEAST_AS_SEVERE_AS , LTTNG_LOG_LEVEL_RULE_TYPE_UNKNOWN }
 Log level rule type. More...
 

Functions

struct lttng_log_level_rulelttng_log_level_rule_at_least_as_severe_as_create (int level)
 Creates a log level rule for which a log level must be at least as severe as level to be satisfied.
 
enum lttng_log_level_rule_status lttng_log_level_rule_at_least_as_severe_as_get_level (const struct lttng_log_level_rule *rule, int *level)
 Sets *level to the level of the “at least as severe as” log level rule rule.
 
void lttng_log_level_rule_destroy (struct lttng_log_level_rule *rule)
 Destroys the log level rule rule.
 
struct lttng_log_level_rulelttng_log_level_rule_exactly_create (int level)
 Creates a log level rule for which a log level must match exactly level to be satisfied.
 
enum lttng_log_level_rule_status lttng_log_level_rule_exactly_get_level (const struct lttng_log_level_rule *rule, int *level)
 Sets *level to the level of the exact match log level rule rule.
 
enum lttng_log_level_rule_type lttng_log_level_rule_get_type (const struct lttng_log_level_rule *rule)
 Returns the type of the log level rule rule.
 

Detailed Description

A log level rule indicates how to match an instrumentation point log level within an event rule.

See the instrumentation point log level event rule condition to learn more.

Create a log level rule for which a log level must be exactly a given value with lttng_log_level_rule_exactly_create().

Create a log level rule for which a log level must be at least as severe as a given value with lttng_log_level_rule_at_least_as_severe_as_create().

Get the type of a log level rule with lttng_log_level_rule_get_type().

Destroy a log level rule with lttng_log_level_rule_destroy().

Enumeration Type Documentation

◆ lttng_log_level_rule_status

Return type of log level rule API functions.

Enumerator
LTTNG_LOG_LEVEL_RULE_STATUS_OK 

Success.

LTTNG_LOG_LEVEL_RULE_STATUS_ERROR 

Error.

LTTNG_LOG_LEVEL_RULE_STATUS_INVALID 

Unsatisfied precondition.

◆ lttng_log_level_rule_type

Log level rule type.

Get the type of a log level rule with lttng_log_level_rule_get_type().

Enumerator
LTTNG_LOG_LEVEL_RULE_TYPE_EXACTLY 

Exact match.

LTTNG_LOG_LEVEL_RULE_TYPE_AT_LEAST_AS_SEVERE_AS 

“At least as severe as” match.

LTTNG_LOG_LEVEL_RULE_TYPE_UNKNOWN 

Unknown (error).

Function Documentation

◆ lttng_log_level_rule_at_least_as_severe_as_create()

struct lttng_log_level_rule * lttng_log_level_rule_at_least_as_severe_as_create ( int  level)
extern

Creates a log level rule for which a log level must be at least as severe as level to be satisfied.

Parameters
[in]level

Log level to compare to.

You may use one of the enumerators of lttng_loglevel, lttng_loglevel_jul, lttng_loglevel_log4j, lttng_loglevel_log4j2, and lttng_loglevel_python.

Returns

“At least as severe as” log level rule on success, or NULL on error.

Destroy the returned log level rule with lttng_log_level_rule_destroy().

◆ lttng_log_level_rule_at_least_as_severe_as_get_level()

enum lttng_log_level_rule_status lttng_log_level_rule_at_least_as_severe_as_get_level ( const struct lttng_log_level_rule rule,
int *  level 
)
extern

Sets *level to the level of the “at least as severe as” log level rule rule.

Parameters
[in]rule“At least as severe as” log level rule of which to get the level.
[out]levelOn success, this function sets *level to the level of rule.
Return values
LTTNG_LOG_LEVEL_RULE_STATUS_OKSuccess.
LTTNG_LOG_LEVEL_RULE_STATUS_ERRORError.
LTTNG_LOG_LEVEL_RULE_STATUS_INVALIDUnsatisfied precondition.
Precondition

◆ lttng_log_level_rule_destroy()

void lttng_log_level_rule_destroy ( struct lttng_log_level_rule rule)
extern

Destroys the log level rule rule.

Parameters
[in]rule

Log level rule to destroy.

May be NULL.

◆ lttng_log_level_rule_exactly_create()

struct lttng_log_level_rule * lttng_log_level_rule_exactly_create ( int  level)
extern

Creates a log level rule for which a log level must match exactly level to be satisfied.

Parameters
[in]level

Exact log level to match.

You may use one of the enumerators of lttng_loglevel, lttng_loglevel_jul, lttng_loglevel_log4j, lttng_loglevel_log4j2, and lttng_loglevel_python.

Returns

Exact match log level rule on success, or NULL on error.

Destroy the returned log level rule with lttng_log_level_rule_destroy().

◆ lttng_log_level_rule_exactly_get_level()

enum lttng_log_level_rule_status lttng_log_level_rule_exactly_get_level ( const struct lttng_log_level_rule rule,
int *  level 
)
extern

Sets *level to the level of the exact match log level rule rule.

Parameters
[in]ruleExact match log level rule of which to get the level.
[out]levelOn success, this function sets *level to the level of rule.
Return values
LTTNG_LOG_LEVEL_RULE_STATUS_OKSuccess.
LTTNG_LOG_LEVEL_RULE_STATUS_ERRORError.
LTTNG_LOG_LEVEL_RULE_STATUS_INVALIDUnsatisfied precondition.
Precondition

◆ lttng_log_level_rule_get_type()

enum lttng_log_level_rule_type lttng_log_level_rule_get_type ( const struct lttng_log_level_rule rule)
extern

Returns the type of the log level rule rule.

Parameters
[in]ruleLog level rule of which to get the type.
Returns
Type of rule.
Precondition
  • rule is not NULL.