Skip to content

Commit 09648a4

Browse files
hahuja2mfulb
authored andcommitted
chore(axiom): format function
1 parent b7fe442 commit 09648a4

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
@@ -1642,29 +1642,26 @@ void nr_txn_record_error(nrtxn_t* txn,
16421642
nr_free(span_id);
16431643
}
16441644

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

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

@@ -1701,41 +1698,50 @@ void nr_txn_record_error_with_additional_attributes(nrtxn_t* txn,
17011698
current_segment = nr_txn_get_current_segment(txn, NULL);
17021699

17031700
if (current_segment) {
1704-
nr_segment_set_error_with_additional_params(current_segment, error_message, error_class, error_file, error_line, error_context, error_no);
1701+
nr_segment_set_error_with_additional_params(
1702+
current_segment, error_message, error_class, error_file, error_line,
1703+
error_context, error_no);
17051704
nrl_verbosedebug(NRL_TXN,
1706-
"recording segment error: msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d'"
1705+
"recording segment error: msg='%.48s' cls='%.48s' "
1706+
"file='%.48s' line='%d' context='%.48s' num='%d'"
17071707
"span_id='%.48s'",
1708-
NRSAFESTR(error_message), NRSAFESTR(error_class), NRSAFESTR(error_file), error_line, NRSAFESTR(error_context), error_no,
1708+
NRSAFESTR(error_message), NRSAFESTR(error_class),
1709+
NRSAFESTR(error_file), error_line,
1710+
NRSAFESTR(error_context), error_no,
17091711
NRSAFESTR(span_id));
17101712
}
17111713
}
17121714
}
1713-
error = nr_error_create_additional_params(priority, error_message, error_class, error_file,
1714-
error_line, error_context, error_no, stacktrace_json,
1715-
span_id, nr_get_time());
1715+
error = nr_error_create_additional_params(
1716+
priority, error_message, error_class, error_file, error_line,
1717+
error_context, error_no, stacktrace_json, span_id, nr_get_time());
17161718

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

0 commit comments

Comments
 (0)