Skip to content

Commit f49637c

Browse files
committed
chore(axiom): format function
1 parent 40b22b7 commit f49637c

File tree

1 file changed

+38
-32
lines changed

1 file changed

+38
-32
lines changed

axiom/nr_txn.c

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,29 +1641,26 @@ void nr_txn_record_error(nrtxn_t* txn,
16411641
nr_free(span_id);
16421642
}
16431643

1644-
void nr_txn_record_error_with_additional_attributes(nrtxn_t* txn,
1645-
int priority,
1646-
bool add_to_current_segment,
1647-
const char* error_message,
1648-
const char* error_class,
1649-
const char* error_file,
1650-
int error_line,
1651-
char* error_context,
1652-
int error_no,
1653-
const char* stacktrace_json) {
1644+
void nr_txn_record_error_with_additional_attributes(
1645+
nrtxn_t* txn,
1646+
int priority,
1647+
bool add_to_current_segment,
1648+
const char* error_message,
1649+
const char* error_class,
1650+
const char* error_file,
1651+
int error_line,
1652+
char* error_context,
1653+
int error_no,
1654+
const char* stacktrace_json) {
16541655
nr_segment_t* current_segment = NULL;
16551656
char* span_id = NULL;
16561657
nr_error_t* error = NULL;
16571658

1658-
if (nrunlikely((0 == txn) || (0 == txn->options.err_enabled) || (0 == error_message)
1659-
|| (0 == txn->status.recording)
1660-
|| (0 == error_message[0])
1661-
|| (0 == stacktrace_json)
1662-
|| (0 == error_class)
1663-
|| (0 == error_file)
1664-
|| (0 == error_line)
1665-
|| (0 == error_context)
1666-
|| (0 == error_no))) {
1659+
if (nrunlikely((0 == txn) || (0 == txn->options.err_enabled)
1660+
|| (0 == error_message) || (0 == txn->status.recording)
1661+
|| (0 == error_message[0]) || (0 == stacktrace_json)
1662+
|| (0 == error_class) || (0 == error_file) || (0 == error_line)
1663+
|| (0 == error_context) || (0 == error_no))) {
16671664
return;
16681665
}
16691666

@@ -1700,41 +1697,50 @@ void nr_txn_record_error_with_additional_attributes(nrtxn_t* txn,
17001697
current_segment = nr_txn_get_current_segment(txn, NULL);
17011698

17021699
if (current_segment) {
1703-
nr_segment_set_error_with_additional_params(current_segment, error_message, error_class, error_file, error_line, error_context, error_no);
1700+
nr_segment_set_error_with_additional_params(
1701+
current_segment, error_message, error_class, error_file, error_line,
1702+
error_context, error_no);
17041703
nrl_verbosedebug(NRL_TXN,
1705-
"recording segment error: msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d'"
1704+
"recording segment error: msg='%.48s' cls='%.48s' "
1705+
"file='%.48s' line='%d' context='%.48s' num='%d'"
17061706
"span_id='%.48s'",
1707-
NRSAFESTR(error_message), NRSAFESTR(error_class), NRSAFESTR(error_file), error_line, NRSAFESTR(error_context), error_no,
1707+
NRSAFESTR(error_message), NRSAFESTR(error_class),
1708+
NRSAFESTR(error_file), error_line,
1709+
NRSAFESTR(error_context), error_no,
17081710
NRSAFESTR(span_id));
17091711
}
17101712
}
17111713
}
1712-
error = nr_error_create_additional_params(priority, error_message, error_class, error_file,
1713-
error_line, error_context, error_no, stacktrace_json,
1714-
span_id, nr_get_time());
1714+
error = nr_error_create_additional_params(
1715+
priority, error_message, error_class, error_file, error_line,
1716+
error_context, error_no, stacktrace_json, span_id, nr_get_time());
17151717

17161718
/*
17171719
* Ensure previous error is destroyed only we have a valid one to replace it
17181720
* with.
17191721
*/
1720-
1722+
17211723
if (nrunlikely(NULL == error)) {
17221724
nrl_verbosedebug(NRL_TXN,
17231725
"The following returned NULL from create error: "
1724-
"priority=%d msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d' span_id='%.48s'",
1725-
priority, NRSAFESTR(error_message), NRSAFESTR(error_class), NRSAFESTR(error_file), error_line, NRSAFESTR(error_context), error_no,
1726-
NRSAFESTR(span_id));
1726+
"priority=%d msg='%.48s' cls='%.48s' file='%.48s' "
1727+
"line='%d' context='%.48s' num='%d' span_id='%.48s'",
1728+
priority, NRSAFESTR(error_message), NRSAFESTR(error_class),
1729+
NRSAFESTR(error_file), error_line,
1730+
NRSAFESTR(error_context), error_no, NRSAFESTR(span_id));
17271731
return;
17281732
}
17291733
if (txn->error) {
17301734
nr_error_destroy_additional_params(&txn->error);
17311735
}
17321736
txn->error = error;
17331737
nrl_verbosedebug(NRL_TXN,
1734-
"recording error priority=%d msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d'"
1738+
"recording error priority=%d msg='%.48s' cls='%.48s' "
1739+
"file='%.48s' line='%d' context='%.48s' num='%d'"
17351740
"span_id='%.48s'",
1736-
priority, NRSAFESTR(error_message), NRSAFESTR(error_class), NRSAFESTR(error_file), error_line, NRSAFESTR(error_context), error_no,
1737-
NRSAFESTR(span_id));
1741+
priority, NRSAFESTR(error_message), NRSAFESTR(error_class),
1742+
NRSAFESTR(error_file), error_line, NRSAFESTR(error_context),
1743+
error_no, NRSAFESTR(span_id));
17381744
nr_free(span_id);
17391745
}
17401746

0 commit comments

Comments
 (0)