aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-logcat.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2015-03-01 18:08:20 +0100
committerMichal Labedzki <michal.labedzki@tieto.com>2015-03-04 18:57:26 +0000
commite4b8e9f18e8cc8e81c2952f956d4bd1fc088ad89 (patch)
tree390360fbbb645c21cf993daf2ead73692a21cf0d /epan/dissectors/packet-logcat.c
parent23b07cb3ca4b54e83f0e161a263f64ce98b2fa5a (diff)
Logcat: Add preference for oneline info column
In fact user may want to disable oneline info column what changes view to multiple lines of log then increases readability. Change-Id: I8aeb1af10abfe8cd56e441d4ebf17cd1526efc89 Reviewed-on: https://code.wireshark.org/review/7524 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-logcat.c')
-rw-r--r--epan/dissectors/packet-logcat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/dissectors/packet-logcat.c b/epan/dissectors/packet-logcat.c
index 6515477716..be52f39a45 100644
--- a/epan/dissectors/packet-logcat.c
+++ b/epan/dissectors/packet-logcat.c
@@ -28,6 +28,7 @@
#include <epan/expert.h>
#include <epan/exported_pdu.h>
#include <epan/tap.h>
+#include <epan/prefs.h>
#include <wiretap/wtap.h>
static int proto_logcat = -1;
@@ -57,6 +58,8 @@ static gint exported_pdu_tap = -1;
static expert_field ei_invalid_payload_length = EI_INIT;
+static gboolean pref_one_line_info_column = TRUE;
+
const value_string priority_vals[] = {
{ 0x00, "Unknown" },
{ 0x01, "Default" },
@@ -165,10 +168,12 @@ dissect_logcat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
log = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_length, ENC_ASCII);
/* New line characters convert to spaces to ensure column Info display one line */
+ if (pref_one_line_info_column) {
while ((c = g_utf8_strchr(log, string_length, '\n')))
*c = ' ';
while ((c = g_utf8_strchr(log, string_length, '\r')))
*c = ' ';
+ }
subitem = proto_tree_add_item(maintree, hf_logcat_log, tvb, offset, string_length, ENC_ASCII | ENC_NA);
subtree = proto_item_add_subtree(subitem, ett_logcat_log);
@@ -199,6 +204,7 @@ dissect_logcat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
void
proto_register_logcat(void)
{
+ module_t *module;
expert_module_t *expert_module;
static hf_register_info hf[] = {
{ &hf_logcat_version,
@@ -287,6 +293,12 @@ proto_register_logcat(void)
expert_register_field_array(expert_module, ei, array_length(ei));
exported_pdu_tap = register_export_pdu_tap("Logcat");
+
+ module = prefs_register_protocol(proto_logcat, NULL);
+ prefs_register_bool_preference(module, "oneline_info_column",
+ "Use oneline info column",
+ "Use oneline info column by replace all new characters by spaces",
+ &pref_one_line_info_column);
}