logging: separate the '<000b>' subsys from filename logging

Add a separate flag and API to switch the category-in-hex output:
log_set_print_category_hex().

Add log_set_print_filename2() to modify only the print_filename flag. The old
log_set_print_filename() function still affects both flags. Explain the
rationale in the comment for log_set_print_filename().

There is no need to deprecate log_set_print_filename(); it might cause compiler
warnings and break strict builds unnecessarily.

Add VTY command 'logging print category-hex (0|1)'.

Since there is no VTY command to switch filename output, nothing needs to be
adjusted there (a command will be added in a subsequent patch).

Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 5914822..fd76d04 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -203,6 +203,23 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(logging_prnt_cat_hex,
+      logging_prnt_cat_hex_cmd,
+      "logging print category-hex (0|1)",
+	LOGGING_STR "Log output settings\n"
+	"Configure log message\n"
+	"Don't prefix each log message\n"
+	"Prefix each log message with category/subsystem nr in hex ('<000b>')\n")
+{
+	struct log_target *tgt = osmo_log_vty2tgt(vty);
+
+	if (!tgt)
+		return CMD_WARNING;
+
+	log_set_print_category_hex(tgt, atoi(argv[0]));
+	return CMD_SUCCESS;
+}
+
 DEFUN(logging_prnt_level,
       logging_prnt_level_cmd,
       "logging print level (0|1)",
@@ -802,6 +819,7 @@
 	install_element_ve(&logging_prnt_timestamp_cmd);
 	install_element_ve(&logging_prnt_ext_timestamp_cmd);
 	install_element_ve(&logging_prnt_cat_cmd);
+	install_element_ve(&logging_prnt_cat_hex_cmd);
 	install_element_ve(&logging_prnt_level_cmd);
 	install_element_ve(&logging_set_category_mask_cmd);
 	install_element_ve(&logging_set_category_mask_old_cmd);
@@ -819,6 +837,7 @@
 	install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd);
 	install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd);
 	install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd);
+	install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd);
 	install_element(CFG_LOG_NODE, &logging_prnt_level_cmd);
 	install_element(CFG_LOG_NODE, &logging_level_cmd);