Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 5540453

Browse files
committed
Merge pull request #206 from mfine/mfine-remove-newlines
Remove newlines from logs
2 parents 01ff809 + 5d19404 commit 5540453

File tree

9 files changed

+59
-59
lines changed

9 files changed

+59
-59
lines changed

src/ambiguity_test.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void update_ambiguity_test(double ref_ecef[3], double phase_var, double code_var
324324

325325
/* Error */
326326
if (valid_sdiffs != 0) {
327-
log_error("update_ambiguity_test: invalid sdiffs. return code: %i\n", valid_sdiffs);
327+
log_error("update_ambiguity_test: invalid sdiffs. return code: %i", valid_sdiffs);
328328
DEBUG_EXIT();
329329
return;
330330
}
@@ -509,7 +509,7 @@ void test_ambiguities(ambiguity_test_t *amb_test, double *dd_measurements)
509509
memory_pool_filter(amb_test->pool, (void *) &x, &update_and_get_max_ll);
510510
memory_pool_filter(amb_test->pool, (void *) &x, &filter_and_renormalize);
511511
if (memory_pool_empty(amb_test->pool)) {
512-
log_debug("Ambiguity pool empty\n");
512+
log_debug("Ambiguity pool empty");
513513
/* Initialize pool with single element with num_dds = 0, i.e.
514514
* zero length N vector, i.e. no satellites. When we take the
515515
* product of this single element with the set of new satellites
@@ -583,7 +583,7 @@ s8 sats_match(const ambiguity_test_t *amb_test, const u8 num_sdiffs, const sdiff
583583
printf("}\n");
584584
}
585585
if (amb_test->sats.num_sats != num_sdiffs) {
586-
log_debug("sats don't match (different length)\n");
586+
log_debug("sats don't match (different length)");
587587
DEBUG_EXIT();
588588
return 0;
589589
}
@@ -592,7 +592,7 @@ s8 sats_match(const ambiguity_test_t *amb_test, const u8 num_sdiffs, const sdiff
592592
u8 j=0;
593593
for (u8 i = 1; i<amb_test->sats.num_sats; i++) { //TODO will not having a j condition cause le fault du seg?
594594
if (j >= num_sdiffs) {
595-
log_debug("sats don't match\n");
595+
log_debug("sats don't match");
596596
DEBUG_EXIT();
597597
return 0;
598598
}
@@ -604,7 +604,7 @@ s8 sats_match(const ambiguity_test_t *amb_test, const u8 num_sdiffs, const sdiff
604604
i--;
605605
}
606606
else {
607-
log_debug("sats don't match\n");
607+
log_debug("sats don't match");
608608
DEBUG_EXIT();
609609
return 0;
610610
}
@@ -675,7 +675,7 @@ u8 ambiguity_update_reference(ambiguity_test_t *amb_test, const u8 num_sdiffs, c
675675

676676
s8 sats_management_code = rebase_sats_management(&amb_test->sats, num_sdiffs, sdiffs, sdiffs_with_ref_first);
677677
if (sats_management_code != OLD_REF) {
678-
log_debug("updating iar reference sat\n");
678+
log_debug("updating iar reference sat");
679679
changed_ref = 1;
680680
if (sats_management_code == NEW_REF_START_OVER) {
681681
create_ambiguity_test(amb_test);
@@ -752,7 +752,7 @@ u8 ambiguity_sat_projection(ambiguity_test_t *amb_test, const u8 num_dds_in_inte
752752

753753
u8 num_dds_before_proj = CLAMP_DIFF(amb_test->sats.num_sats, 1);
754754
if (num_dds_before_proj == num_dds_in_intersection) {
755-
log_debug("no need for projection\n");
755+
log_debug("no need for projection");
756756
DEBUG_EXIT();
757757
return 0;
758758
}
@@ -761,13 +761,13 @@ u8 ambiguity_sat_projection(ambiguity_test_t *amb_test, const u8 num_dds_in_inte
761761
memcpy(intersection.intersection_ndxs, dd_intersection_ndxs, num_dds_in_intersection * sizeof(u8));
762762

763763

764-
log_info("IAR: %"PRIu32" hypotheses before projection\n", memory_pool_n_allocated(amb_test->pool));
764+
log_info("IAR: %"PRIu32" hypotheses before projection", memory_pool_n_allocated(amb_test->pool));
765765
memory_pool_group_by(amb_test->pool,
766766
&intersection, &projection_comparator,
767767
&intersection, sizeof(intersection),
768768
&projection_aggregator);
769-
log_info("IAR: updates to %"PRIu32"\n", memory_pool_n_allocated(amb_test->pool));
770-
log_info("After projection, num_sats = %d\n", num_dds_in_intersection + 1);
769+
log_info("IAR: updates to %"PRIu32"", memory_pool_n_allocated(amb_test->pool));
770+
log_info("After projection, num_sats = %d", num_dds_in_intersection + 1);
771771
u8 work_prns[MAX_CHANNELS];
772772
memcpy(work_prns, amb_test->sats.prns, amb_test->sats.num_sats * sizeof(u8));
773773
for (u8 i=0; i<num_dds_in_intersection; i++) {
@@ -902,7 +902,7 @@ static void remap_prns(ambiguity_test_t *amb_test, u8 ref_prn,
902902
j++;
903903
k++;
904904
} else {
905-
log_error("remap_prns: impossible condition reached.\n");
905+
log_error("remap_prns: impossible condition reached.");
906906
printf("old_prns = [");
907907
for (u8 ii=0; ii < x->old_dim; ii++) {
908908
printf("%d, ",old_prns[ii]);
@@ -1001,8 +1001,8 @@ static s32 add_sats(ambiguity_test_t *amb_test,
10011001
&intersection_hypothesis_prod);
10021002
(void) count;
10031003
s32 num_hyps = memory_pool_n_allocated(amb_test->pool);
1004-
log_info("IAR: updates to %"PRIu32"\n", num_hyps);
1005-
log_info("add_sats. num sats: %i\n", amb_test->sats.num_sats);
1004+
log_info("IAR: updates to %"PRIu32"", num_hyps);
1005+
log_info("add_sats. num sats: %i", amb_test->sats.num_sats);
10061006
return num_hyps;
10071007
}
10081008

@@ -1071,18 +1071,18 @@ static u8 inclusion_loop_body(
10711071
compute_Z(num_current_dds, num_dds_to_add, x->Z1, x->Z2_inv, x->Z);
10721072

10731073
if (full_size <= max_num_hyps) {
1074-
log_debug("BRANCH 1: num dds: %i. full size: %"PRIu32", itr size: %"PRIu32"\n", num_dds_to_add, full_size, box_size);
1074+
log_debug("BRANCH 1: num dds: %i. full size: %"PRIu32", itr size: %"PRIu32"", num_dds_to_add, full_size, box_size);
10751075
/* The hypotheses generated for these double-differences fit. */
10761076
return 1;
10771077
} else if (box_size * current_num_hyps <= max_iteration_size) {
1078-
log_debug("BRANCH 2: num dds: %i. full size: %"PRIu32", itr size: %"PRIu32"\n", num_dds_to_add, full_size, box_size);
1078+
log_debug("BRANCH 2: num dds: %i. full size: %"PRIu32", itr size: %"PRIu32"", num_dds_to_add, full_size, box_size);
10791079

10801080
x->intersection_size = 0;
10811081

10821082
/* Do intersection */
10831083
memory_pool_fold(pool, (void *)x, &fold_intersection_count);
10841084

1085-
log_debug("intersection size: %i\n", x->intersection_size);
1085+
log_debug("intersection size: %i", x->intersection_size);
10861086

10871087
if (x->intersection_size < max_num_hyps) {
10881088
/* The hypotheses generated for these double-differences fit. */
@@ -1264,7 +1264,7 @@ u8 ambiguity_sat_inclusion(ambiguity_test_t *amb_test, const u8 num_dds_in_inter
12641264
}
12651265
}
12661266
}
1267-
log_debug("BRANCH 3: covariance too large. full: %"PRIu32"\n", full_size);
1267+
log_debug("BRANCH 3: covariance too large. full: %"PRIu32"", full_size);
12681268
/* Covariance too large, nothing added. */
12691269
return 0;
12701270
}
@@ -1277,7 +1277,7 @@ u8 ambiguity_sat_inclusion_old(ambiguity_test_t *amb_test, u8 num_dds_in_interse
12771277
DEBUG_ENTRY();
12781278

12791279
if (float_sats->num_sats <= num_dds_in_intersection + 1 || float_sats->num_sats < 2) {
1280-
log_debug("no need for inclusion\n");
1280+
log_debug("no need for inclusion");
12811281
DEBUG_EXIT();
12821282
return 0;
12831283
}
@@ -1340,11 +1340,11 @@ u8 ambiguity_sat_inclusion_old(ambiguity_test_t *amb_test, u8 num_dds_in_interse
13401340
Z_inv);
13411341
if (add_any_sats == 1) {
13421342
add_sats_old(amb_test, float_prns[0], num_dds_to_add, new_dd_prns, lower_bounds, upper_bounds, Z_inv);
1343-
log_debug("adding sats\n");
1343+
log_debug("adding sats");
13441344
DEBUG_EXIT();
13451345
return 1;
13461346
} else {
1347-
log_debug("not adding sats\n");
1347+
log_debug("not adding sats");
13481348
DEBUG_EXIT();
13491349
return 0;
13501350
}
@@ -1484,7 +1484,7 @@ u8 ambiguity_update_sats(ambiguity_test_t *amb_test, const u8 num_sdiffs,
14841484

14851485
if (num_sdiffs < 2) {
14861486
create_ambiguity_test(amb_test);
1487-
log_debug("< 2 sdiffs, starting over\n");
1487+
log_debug("< 2 sdiffs, starting over");
14881488
DEBUG_EXIT();
14891489
return 0; // I chose 0 because it doesn't lead to anything dynamic
14901490
}
@@ -1526,7 +1526,7 @@ u8 ambiguity_update_sats(ambiguity_test_t *amb_test, const u8 num_sdiffs,
15261526
changed_sats = 1;
15271527
}
15281528
}
1529-
log_debug("changed_sats = %u\n", changed_sats);
1529+
log_debug("changed_sats = %u", changed_sats);
15301530

15311531
DEBUG_EXIT();
15321532
return changed_sats;
@@ -1559,20 +1559,20 @@ u8 find_indices_of_intersection_sats(const ambiguity_test_t *amb_test, const u8
15591559
u8 k = 0;
15601560
while (i < amb_test->sats.num_sats && j < num_sdiffs) {
15611561
if (amb_test->sats.prns[i] == sdiffs_with_ref_first[j].prn) {
1562-
log_debug("(%u, \t%u, \t%u, \t%u, \t%u)\t\t\tamb_test->sats.prns[i] == sdiffs_with_ref_first[j].prn; i,j,k++\n",
1562+
log_debug("(%u, \t%u, \t%u, \t%u, \t%u)\t\t\tamb_test->sats.prns[i] == sdiffs_with_ref_first[j].prn; i,j,k++",
15631563
i, j, k, amb_test->sats.prns[i], sdiffs_with_ref_first[j].prn);
15641564
intersection_ndxs[k] = i-1;
15651565
i++;
15661566
j++;
15671567
k++;
15681568
}
15691569
else if (amb_test->sats.prns[i] < sdiffs_with_ref_first[j].prn) {
1570-
log_debug("(%u, \t%u, \t%u, \t%u, \t%u)\t\t\tamb_test->sats.prns[i] < sdiffs_with_ref_first[j].prn; i++\n",
1570+
log_debug("(%u, \t%u, \t%u, \t%u, \t%u)\t\t\tamb_test->sats.prns[i] < sdiffs_with_ref_first[j].prn; i++",
15711571
i, j, k, amb_test->sats.prns[i], sdiffs_with_ref_first[j].prn);
15721572
i++;
15731573
}
15741574
else {
1575-
log_debug("(%u, \t%u, \t%u, \t%u, \t%u)\t\t\tamb_test->sats.prns[i] > sdiffs_with_ref_first[j].prn; j++\n",
1575+
log_debug("(%u, \t%u, \t%u, \t%u, \t%u)\t\t\tamb_test->sats.prns[i] > sdiffs_with_ref_first[j].prn; j++",
15761576
i, j, k, amb_test->sats.prns[i], sdiffs_with_ref_first[j].prn);
15771577
j++;
15781578
}
@@ -1685,7 +1685,7 @@ void add_sats_old(ambiguity_test_t *amb_test,
16851685
j++;
16861686
k++;
16871687
} else {
1688-
log_error("add_sats_old: impossible condition reached.\n");
1688+
log_error("add_sats_old: impossible condition reached.");
16891689
printf("old_prns = [");
16901690
for (u8 ii=0; ii < x0.num_old_dds; ii++) {
16911691
printf("%d, ",old_prns[ii]);
@@ -1708,15 +1708,15 @@ void add_sats_old(ambiguity_test_t *amb_test,
17081708
empty_element->ll = 0; // only in init
17091709
}
17101710

1711-
log_info("IAR: %"PRIu32" hypotheses before inclusion\n", memory_pool_n_allocated(amb_test->pool));
1711+
log_info("IAR: %"PRIu32" hypotheses before inclusion", memory_pool_n_allocated(amb_test->pool));
17121712
if (DEBUG) {
17131713
memory_pool_map(amb_test->pool, &x0.num_old_dds, &print_hyp);
17141714
}
17151715
memcpy(x0.Z_inv, Z_inv, num_added_dds * num_added_dds * sizeof(z_t));
17161716
/* Take the product of our current hypothesis state with the generator, recorrelating the new ones as we go. */
17171717
memory_pool_product_generator(amb_test->pool, &x0, MAX_HYPOTHESES, sizeof(x0),
17181718
&no_init, &generate_next_hypothesis, &hypothesis_prod);
1719-
log_info("IAR: updates to %"PRIu32"\n", memory_pool_n_allocated(amb_test->pool));
1719+
log_info("IAR: updates to %"PRIu32"", memory_pool_n_allocated(amb_test->pool));
17201720
if (DEBUG) {
17211721
memory_pool_map(amb_test->pool, &k, &print_hyp);
17221722
}

src/baseline.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ s8 lesq_solution_float(u8 num_dds_u8, const double *dd_obs, const double *N,
299299
&info); /* INFO. */
300300

301301
if (info != 0) {
302-
log_error("dgelsy returned error %"PRId32"\n", info);
302+
log_error("dgelsy returned error %"PRId32"", info);
303303
return -2;
304304
}
305305

@@ -592,7 +592,7 @@ s8 baseline_(u8 num_sdiffs, const sdiff_t *sdiffs, const double ref_ecef[3],
592592

593593
if (valid_sdiffs < 0) {
594594
if (valid_sdiffs != -1) {
595-
log_error("baseline: Invalid sdiffs\n");
595+
log_error("baseline: Invalid sdiffs");
596596
}
597597
return -2;
598598
}

src/dgnss_management.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void dgnss_rebase_ref(u8 num_sdiffs, sdiff_t *sdiffs, double receiver_ecef[3], u
138138
/* all the ref sat stuff */
139139
s8 sats_management_code = rebase_sats_management(&sats_management, num_sdiffs, sdiffs, corrected_sdiffs);
140140
if (sats_management_code == NEW_REF_START_OVER) {
141-
log_info("Unable to rebase to new ref, resetting filters and starting over\n");
141+
log_info("Unable to rebase to new ref, resetting filters and starting over");
142142
dgnss_init(num_sdiffs, sdiffs, receiver_ecef);
143143
memcpy(old_prns, sats_management.prns, sats_management.num_sats * sizeof(u8));
144144
if (num_sdiffs >= 1) {
@@ -297,7 +297,7 @@ void dgnss_update(u8 num_sats, sdiff_t *sdiffs, double receiver_ecef[3],
297297
disable_raim, raim_threshold);
298298

299299
if (code < 0) {
300-
log_warn("dgnss_update. baseline estimate error: %d\n", code);
300+
log_warn("dgnss_update. baseline estimate error: %d", code);
301301
/* Use b = 0, continue */
302302
memset(b2, 0, sizeof(b2));
303303
}
@@ -420,8 +420,8 @@ s8 dgnss_baseline(u8 num_sdiffs, const sdiff_t *sdiffs,
420420
disable_raim, raim_threshold);
421421
if (ret >= 0) {
422422
if (ret == 1) /* TODO: Export this rather than just printing */
423-
log_warn("dgnss_baseline: Fixed baseline RAIM repair\n");
424-
log_debug("fixed solution\n");
423+
log_warn("dgnss_baseline: Fixed baseline RAIM repair");
424+
log_debug("fixed solution");
425425
DEBUG_EXIT();
426426
return 1;
427427
}
@@ -431,12 +431,12 @@ s8 dgnss_baseline(u8 num_sdiffs, const sdiff_t *sdiffs,
431431
disable_raim, raim_threshold))
432432
>= 0) {
433433
if (ret == 1) /* TODO: Export this rather than just printing */
434-
log_warn("dgnss_baseline: Float baseline RAIM repair\n");
435-
log_debug("float solution\n");
434+
log_warn("dgnss_baseline: Float baseline RAIM repair");
435+
log_debug("float solution");
436436
DEBUG_EXIT();
437437
return 2;
438438
}
439-
log_debug("no baseline solution\n");
439+
log_debug("no baseline solution");
440440
DEBUG_EXIT();
441441
return ret;
442442
}
@@ -597,7 +597,7 @@ static u8 get_de_and_phase(sats_management_t *sats_man,
597597
}
598598
else if (sdiffs[j].prn > sats_man->prns[i]) {
599599
/* This should never happen. */
600-
log_warn("sdiffs should be a super set of sats_man prns\n");
600+
log_warn("sdiffs should be a super set of sats_man prns");
601601
i++;
602602
}
603603
else { /* else they match */

src/ephemeris.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ s8 calc_sat_state(const ephemeris_t *ephemeris, gps_time_t t,
6363

6464
/* If dt is greater than 4 hours our ephemeris isn't valid. */
6565
if (fabs(dt) > EPHEMERIS_VALID_TIME) {
66-
log_error("Using ephemeris outside validity period, dt = %+.0f\n", dt);
66+
log_error("Using ephemeris outside validity period, dt = %+.0f", dt);
6767
return -1;
6868
}
6969

src/filter_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ s8 assign_de_mtx(u8 num_sats, const sdiff_t *sats_with_ref_first,
5252
assert(DE != NULL);
5353

5454
if (num_sats <= 1) {
55-
log_debug("assign_de_mtx: not enough sats\n");
55+
log_debug("assign_de_mtx: not enough sats");
5656
return -1;
5757
}
5858

src/lambda.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int LD(int n, const double *Q, double *L, double *D)
5151
}
5252
if (info) {
5353
log_error("%s : LD factorization error, trying UD from Gibbs "
54-
"(col major UD = LD)\n", __FILE__);
54+
"(col major UD = LD)", __FILE__);
5555
double Qcopy[n * n];
5656
memcpy(Qcopy, Q, n * n * sizeof(double));
5757
matrix_udu(n, Qcopy, L, D);
@@ -163,7 +163,7 @@ static int search(int n, int m, const double *L, const double *D,
163163
}
164164

165165
if (c>=LOOPMAX) {
166-
log_error("LAMBDA search loop count overflow\n");
166+
log_error("LAMBDA search loop count overflow");
167167
return -1;
168168
}
169169
return 0;

src/nav_msg.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ s32 nav_msg_update(nav_msg_t *n, s32 corr_prompt_real, u8 ms)
202202
}
203203

204204
if (n->subframe_bit_index >= NAV_MSG_SUBFRAME_BITS_LEN*32) {
205-
log_error("subframe bit index gone wild %d\n", (int)n->subframe_bit_index);
205+
log_error("subframe bit index gone wild %d", (int)n->subframe_bit_index);
206206
return -22;
207207
}
208208

@@ -326,7 +326,7 @@ s8 process_subframe(nav_msg_t *n, ephemeris_t *e) {
326326
// Check parity and parse out the ephemeris from the most recently received subframe
327327

328328
if (!e) {
329-
log_error("process_subframe: CALLED WITH e = NULL!\n");
329+
log_error("process_subframe: CALLED WITH e = NULL!");
330330
n->subframe_start_index = 0; // Mark the subframe as processed
331331
n->next_subframe_id = 1; // Make sure we start again next time
332332
return -1;
@@ -342,20 +342,20 @@ s8 process_subframe(nav_msg_t *n, ephemeris_t *e) {
342342
if ((prev_bit_polarity != BIT_POLARITY_UNKNOWN)
343343
&& (prev_bit_polarity != n->bit_polarity)) {
344344
log_error("PRN %02d Nav phase flip - half cycle slip detected, "
345-
"but not corrected\n", e->prn+1);
345+
"but not corrected", e->prn+1);
346346
/* TODO: declare phase ambiguity to IAR */
347347
}
348348

349349
/* Complain if buffer overrun */
350350
if (n->overrun) {
351-
log_error("PRN %02d nav_msg subframe buffer overrun!\n", e->prn+1);
351+
log_error("PRN %02d nav_msg subframe buffer overrun!", e->prn+1);
352352
n->overrun = false;
353353
}
354354

355355
/* Extract word 2, and the last two parity bits of word 1 */
356356
u32 sf_word2 = extract_word(n, 28, 32, 0);
357357
if (nav_parity(&sf_word2)) {
358-
log_info("PRN %02d subframe parity mismatch (word 2)\n", e->prn+1);
358+
log_info("PRN %02d subframe parity mismatch (word 2)", e->prn+1);
359359
n->subframe_start_index = 0; // Mark the subframe as processed
360360
n->next_subframe_id = 1; // Make sure we start again next time
361361
return -2;
@@ -369,7 +369,7 @@ s8 process_subframe(nav_msg_t *n, ephemeris_t *e) {
369369
n->frame_words[sf_id-1][w] = extract_word(n, 30*(w+2) - 2, 32, 0); // Get the bits
370370
// MSBs are D29* and D30*. LSBs are D1...D30
371371
if (nav_parity(&n->frame_words[sf_id-1][w])) { // Check parity and invert bits if D30*
372-
log_info("PRN %02d subframe parity mismatch (word %d)\n", e->prn+1, w+3);
372+
log_info("PRN %02d subframe parity mismatch (word %d)", e->prn+1, w+3);
373373
n->next_subframe_id = 1; // Make sure we start again next time
374374
n->subframe_start_index = 0; // Mark the subframe as processed
375375
return -3;

0 commit comments

Comments
 (0)