Project

General

Profile

Feature #5034

logging: Enable category name instead of hex val by default

Added by pespin 11 days ago. Updated about 8 hours ago.

Status:
Stalled
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
02/18/2021
Due date:
% Done:

90%

Spec Reference:

Description

Discussion started in this patch:
https://gerrit.osmocom.org/c/libosmocore/+/12095

Summary/outcome:

As a reference, I think it makes more sense to change it for all log targets this way:diff --git a/src/logging.c b/src/logging.c
index a40008e9..f878be5a 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -918,7 +918,8 @@ struct log_target *log_target_create(void)
        target->use_color = 1;
        target->print_timestamp = 0;
        target->print_filename2 = LOG_FILENAME_PATH;
-       target->print_category_hex = true;
+       target->print_category_hex = false;
+       target->print_category = true;

So here actually by default we disable the hex output and we enable the string representation. Once this is applied, some tests will need to be adapted since they may not set those fields explicitly and use default ones.

Steps:
  • Apply change in libosmocore locally
  • Build other projects and see if a test in any projects fails. For each test failing, make sure to set explicit values for log_set_print_category{_hex} to match current expectancies.
  • Once those patches are merged, submit + merge libosmocore patch changing the default.

Associated revisions

Revision 0d2793a2 (diff)
Added by pespin 10 days ago

tests: Set print_category values explicitly

This will alow easily changing default values for print_category vs
print_category_hex later.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Related: OS#5034
Change-Id: If29b40557d5c2bcda04b964f344070bad58d8f28

Revision d66b3fb5 (diff)
Added by pespin 10 days ago

Drop use of log_set_print_filename() API inside libosmocore

Let's use log_set_print_filename2() API instead, which has less ackward
behavior implications like changing the print status of category-hex.

Related: OS#5034
Change-Id: Ifc78e1dcba5baf0b41f6ccbbbd1e3f06552d73da

Revision 6953a830 (diff)
Added by pespin 10 days ago

logging: Deprecate API log_set_print_filename

Let's flag the API as deprecated so that people start using
log_set_print_filename2() API instead, which has less ackward
behavior implications like changing the print status of category-hex.

Related: OS#5034
Change-Id: If9b6b322989536a12094e6105c3aabc84d8be24a

Revision 3512d34b (diff)
Added by pespin 10 days ago

logging: Enable category name instead of hex val by default

Related: OS#5034
Change-Id: I6dc3898958cf60147ad73c52cf0b3990bd26359e

Revision b1ddb98e (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Ia4bcf8dc441ad26cffc3aec5b374fbdca4a03841
Related: OS#5034

Revision 5cac145d (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: I899e63ab2702bf25514f6585fb45f5bbf60a9ac9
Related: OS#5034

Revision 2c6aed38 (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Ia633cae0a26f294e276b431a82256abb1b57ebba
Related: OS#5034

Revision 00ef1b0d (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Icce09882ef3ed07328679594ff84902383d16c72
Related: OS#5034

Revision 3abbb67d (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: I8713f4e04e92b4d7e211c499fc6e78983edfb139
Related: OS#5034

Revision 56237bce (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Iaa77f8a7d3f752173507afd988bd76a8aa632082
Related: OS#5034

Revision 8d02d991 (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: I089c0001fc75e81558c3e860827e4d434cf1eab3
Related: OS#5034

Revision b18d2a5f (diff)
Added by pespin 10 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: I7f9c56313cfaa74ebe666f44763a83d8102f5484
Related: OS#5034

Revision 690b661f (diff)
Added by pespin 9 days ago

tests: Set print_category values explicitly

This will alow easily changing default values for print_category vs
print_category_hex later.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Related: OS#5034
Change-Id: If29b40557d5c2bcda04b964f344070bad58d8f28

Revision 01e0d3e7 (diff)
Added by pespin 9 days ago

Drop use of log_set_print_filename() API inside libosmocore

Let's use log_set_print_filename2() API instead, which has less ackward
behavior implications like changing the print status of category-hex.

Related: OS#5034
Change-Id: Ifc78e1dcba5baf0b41f6ccbbbd1e3f06552d73da

Revision 6e9dd02b (diff)
Added by pespin 9 days ago

logging: Deprecate API log_set_print_filename

Let's flag the API as deprecated so that people start using
log_set_print_filename2() API instead, which has less ackward
behavior implications like changing the print status of category-hex.

Related: OS#5034
Change-Id: If9b6b322989536a12094e6105c3aabc84d8be24a

Revision f25a45ab (diff)
Added by pespin 9 days ago

tests: Explicitly drop category from log

Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: I4d48c0c0aa46065560a020369e3b0544385f173e
Related: OS#5034

Revision 7944a70a (diff)
Added by pespin 6 days ago

logging: Enable category name instead of hex val by default

Related: OS#5034
Change-Id: I6dc3898958cf60147ad73c52cf0b3990bd26359e

History

#1 Updated by pespin 11 days ago

First bunch of related patches (libosmocore only):
remote: https://gerrit.osmocom.org/c/libosmocore/+/22961 tests: Set print_category values explicitly [NEW]
remote: https://gerrit.osmocom.org/c/libosmocore/+/22962 Drop use of log_set_print_filename() API inside libosmocore [NEW]
remote: https://gerrit.osmocom.org/c/libosmocore/+/22963 logging: Deprecate API log_set_print_filename [NEW]
remote: https://gerrit.osmocom.org/c/libosmocore/+/12095 logging: Enable category name instead of hex val by default [WIP]

#2 Updated by pespin 10 days ago

  • Status changed from New to Stalled
  • % Done changed from 0 to 90

I submitted a bunch of patches to explictly set category printing in all tests to avoid breakage starting from current master if we even change the default value.

However, the libosmocore patch changing the default from hex to string (https://gerrit.osmocom.org/c/libosmocore/+/12095) cannot be merged because it would prevent older test versions of different projects to build against newer libosmocore, which is something we want to avoid.

So the idea here is then to keep all tests always setting the category printing settings for a while until we decide backward compatibility is good enough and we can merge the patch.

#3 Updated by pespin about 8 hours ago

  • Priority changed from Normal to Low

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)