wireshark/epan
João Valverde dc7f0b88bb Refactor our logging and extend the wslog API
Experience has shown that:

  1. The current logging methods are not very reliable or practical.
A logging bitmask makes little sense as the user-facing interface (who
would want debug but not crtical messages for example?); it's
computer-friendly and user-unfriendly. More importantly the console
log level preference is initialized too late in the startup process
to be used for the logging subsystem and that fact raises a number
of annoying and hard-to-fix usability issues.

  2. Coding around G_MESSAGES_DEBUG to comply with our log level mask
and not clobber the user's settings or not create unexpected log misses
is unworkable and generally follows the principle of most surprise.
The fact that G_MESSAGES_DEBUG="all" can leak to other programs using
GLib is also annoying.

  3. The non-structured GLib logging API is very opinionated and lacks
configurability beyond replacing the log handler.

  4. Windows GUI has some special code to attach to a console,
but it would be nice to abstract away the rest under a single
interface.

  5. Using this logger seems to be noticeably faster.

Deprecate the console log level preference and extend our API to
implement a log handler in wsutil/wslog.h to provide easy-to-use,
flexible and dependable logging during all execution phases.

Log levels have a hierarchy, from most verbose to least verbose
(debug to error). When a given level is set everything above that
is also enabled.

The log level can be set with an environment variable or a command
line option (parsed as soon as possible but still later than the
environment). The default log level is "message".

Dissector logging is not included because it is not clear what log
domain they should use. An explosion to thousands of domains is
not desirable and putting everything in a single domain is probably
too coarse and noisy. For now I think it makes sense to let them do
their own thing using g_log_default_handler() and continue using the
G_MESSAGES_DEBUG mechanism with specific domains for each individual
dissector.

In the future a mechanism may be added to selectively enable these
domains at runtime while trying to avoid the problems introduced
by G_MESSAGES_DEBUG.
2021-06-11 09:40:28 +00:00
..
crypt ieee80211: Dissect decrypted FT BSS Transition GTK subelem 2021-03-29 11:18:38 +00:00
dfilter dfilter: Disallow embedded NUL bytes in regular strings 2021-06-05 02:47:39 +01:00
dissectors Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
ftypes ftype-protocol: Fix crash when comparing _ws.expert to literals 2021-05-24 22:37:56 +00:00
wmem Allow wmem_strbuf_append_len() to append strings beginning with NUL byte 2021-05-25 03:32:29 +00:00
wslua Try to avoid -Wunused with vanishing macros 2021-06-10 00:51:59 +01:00
.editorconfig
CMakeLists.txt Remove use of PACKAGE_VERSION in maxminddb version 2021-05-19 17:16:01 +00:00
addr_and_mask.c
addr_and_mask.h
addr_resolv.c addr_resolv: repopulate services table on profile switch 2021-05-23 18:50:25 +00:00
addr_resolv.h
address.h
address_types.c Cast away the return value of g_strlcpy() and g_strlcat(). 2021-04-30 03:19:19 -07:00
address_types.h
afn.c
afn.h
aftypes.c
aftypes.h
app_mem_usage.c
app_mem_usage.h
arcnet_pids.h
arptypes.h
asn1.c Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
asn1.h
ax25_pids.h
bridged_pids.h
capture_dissectors.c Remove redundant assertion. 2021-01-19 23:40:31 -08:00
capture_dissectors.h
charsets.c windows-common: fix Clang 2020-11-19 19:01:53 +00:00
charsets.h Use iconv to support GB 18030 and EUC-KR, allow future encodings 2020-10-21 11:26:23 +00:00
chdlctypes.h
cisco_pid.h
color_filters.c Detect and replace bad allocation patterns 2020-12-22 14:56:38 +00:00
color_filters.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
column-info.h column-info.h : increase COL_MAX_LEN from 256 to 2048 2020-12-04 16:11:37 +00:00
column-utils.c Cast away the return value of g_strlcpy() and g_strlcat(). 2021-04-30 03:19:19 -07:00
column-utils.h
column.c Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
column.h
conv_id.h
conversation.c conversation: use the Wayback Machine for a URL. 2021-03-30 14:46:34 -07:00
conversation.h DVB-S2-BB: Add support for TS over BBFrame 2021-06-05 08:12:47 +00:00
conversation_debug.h
conversation_filter.c Detect and replace bad allocation patterns 2020-12-22 14:56:38 +00:00
conversation_filter.h
conversation_table.c TCP: Conversations Statistics loyalty to connections initiators 2021-02-21 13:12:35 +00:00
conversation_table.h
crc6-tvb.c
crc6-tvb.h
crc8-tvb.c Move some variables inside the block where they're used. 2021-01-20 00:44:31 -08:00
crc8-tvb.h
crc10-tvb.c
crc10-tvb.h
crc16-tvb.c
crc16-tvb.h
crc32-tvb.c
crc32-tvb.h
dccpservicecodes.h Added IANA-assigned DCCP Service Codes. 2021-02-19 13:50:35 +01:00
decode_as.c Add FT_STRINGZTRUNC. 2020-09-12 14:16:12 -07:00
decode_as.h
diam_dict.h
diam_dict.l
disabled_protos.c Detect and replace bad allocation patterns 2020-12-22 14:56:38 +00:00
disabled_protos.h
dtd.h
dtd_grammar.lemon
dtd_parse.h
dtd_parse.l
dtd_preparse.l
dvb_chartbl.c
dvb_chartbl.h
eap.h Add a few EAP dissectors 2020-09-21 15:05:05 +00:00
eapol_keydes_types.h
epan.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
epan.h Don't include wsutil/plugins.h in epan/epan.h - it's not necessary. 2021-05-14 23:46:31 -07:00
epan_dissect.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
etypes.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
ex-opt.c
ex-opt.h
except.c Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
except.h
exceptions.h
exntest.c
expert.c Cast away the return value of g_strlcpy() and g_strlcat(). 2021-04-30 03:19:19 -07:00
expert.h Clean up URLs. 2020-10-02 20:13:42 -07:00
export_object.c
export_object.h epan: Change export_object_entry_t.payload_len to size_t 2021-06-08 07:16:22 +00:00
exported_pdu.c
exported_pdu.h exported PDU: Fix comment 2021-06-02 01:09:33 -04:00
filter_expressions.c
filter_expressions.h
follow.c Follow stream: Modify YAML format, add timestamps and peers 2021-05-25 08:09:31 +00:00
follow.h Follow stream: Modify YAML format, add timestamps and peers 2021-05-25 08:09:31 +00:00
frame_data.c pcapng: add support for custom blocks 2021-06-06 21:15:35 +00:00
frame_data.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
frame_data_sequence.c
frame_data_sequence.h
funnel.c wsutils: add local implementation of g_memdup2. 2021-03-25 09:38:10 +00:00
funnel.h funnel: Remove unused typedefs 2020-12-30 11:02:41 +00:00
garrayfix.h
golay.c
golay.h
guid-utils.c
guid-utils.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
iana_charsets.c
iana_charsets.h
iax2_codec_type.h
in_cksum.c
in_cksum.h
ip_opts.h
ipproto.c
ipproto.h
ipv4.h
ipv6.h
lapd_sapi.h
llcsaps.h
maxmind_db.c maxmin_db: Fix a memory leak in maxmind_db_pop_response 2021-05-12 11:58:13 +00:00
maxmind_db.h maxmind: add optional synchronous lookups 2021-04-02 06:48:42 +00:00
media_params.c
media_params.h
next_tvb.c
next_tvb.h
nlpid.h osi/nlpid: Update Avaya proprietary NLPID 2021-04-01 15:45:38 +02:00
oids.c Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
oids.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
oids_test.c Replace g_assert() with g_assert_true() for testing 2021-03-05 14:54:58 +00:00
osi-utils.c Cast away the return value of g_strlcpy() and g_strlcat(). 2021-04-30 03:19:19 -07:00
osi-utils.h
oui.h lldp: Add Extreme/Avaya Fabric Vendor specific sub-TLV decoding 2021-04-01 15:45:38 +02:00
packet.c pcapng: add support for custom blocks 2021-06-06 21:15:35 +00:00
packet.h wsutils: add local implementation of g_memdup2. 2021-03-25 09:38:10 +00:00
packet_info.h
params.h
pci-ids.c NCSI: Squash commits of NCSI and PCI-IDS 2021-02-17 07:10:31 +00:00
pci-ids.h NCSI: Squash commits of NCSI and PCI-IDS 2021-02-17 07:10:31 +00:00
plugin_if.c Detect and replace bad allocation patterns 2020-12-22 14:56:38 +00:00
plugin_if.h plugin_if: add plugin_if_get_frame_data() and plugin_if_get_capture_file() 2020-08-22 05:32:29 +00:00
ppptypes.h
prefs-int.h prefs: get rid of unused PREF_EFFECT_ flags. 2021-04-04 23:13:05 +00:00
prefs.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
prefs.h Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
print.c fix #17369 tshark json now handles mixed children 2021-05-15 13:35:01 +00:00
print.h
print.ps
print_stream.c Detect and replace bad allocation patterns 2020-12-22 14:56:38 +00:00
print_stream.h
proto.c Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
proto.h Add ENC_APN_STR to handle APN strings 2021-05-20 09:27:53 +00:00
proto_data.c proto_data: small cleanups. 2021-04-01 18:52:52 -07:00
proto_data.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
protobuf-helper.c Protobuf: rewrite parser of *.proto file from Bison to Lemon 2020-11-18 08:57:01 +00:00
protobuf-helper.h Protobuf: rewrite parser of *.proto file from Bison to Lemon 2020-11-18 08:57:01 +00:00
protobuf_lang_parser.lemon Add missing prototypes to lemon-generated code. 2021-04-16 18:38:26 +00:00
protobuf_lang_scanner.l protobuf: fix leaking tokens 2021-03-27 17:23:07 +00:00
protobuf_lang_tree.c protobuf: Fix leaking nodes and strings 2021-04-02 07:25:31 +00:00
protobuf_lang_tree.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
ps.h
ptvcursor.h
radius_dict.l
range.c
range.h
reassemble.c reassemble: Improve perf of free_all_reassembled_fragments. 2021-02-22 17:00:54 +10:00
reassemble.h
reassemble_test.c Fix reassemble_test's additional debug mode. 2021-02-21 12:55:58 +00:00
reedsolomon.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
reedsolomon.h
register-int.h
register.c
register.h
req_resp_hdrs.c
req_resp_hdrs.h
rtd_table.c
rtd_table.h
rtp_pt.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
sctpppids.c Added decoding of ProtocolID and PPID into Component Status Protocol dissector. 2021-02-26 15:31:44 +00:00
sctpppids.h Added decoding of ProtocolID and PPID into Component Status Protocol dissector. 2021-02-26 15:31:44 +00:00
secrets.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
secrets.h
sequence_analysis.c voip_calls_dialog/voip_calls: Fix for #16952 2020-12-30 08:51:00 +00:00
sequence_analysis.h voip_calls_dialog/voip_calls: Fix for #16952 2020-12-30 08:51:00 +00:00
show_exception.c first version of reassembly btatt 2021-02-09 05:01:18 +00:00
show_exception.h
slow_protocol_subtypes.h
sminmpec.h
srt_table.c Detect and replace bad allocation patterns 2020-12-22 14:56:38 +00:00
srt_table.h
stat_groups.h Added statistics group for RSerPool protocols. 2021-04-08 09:36:23 +02:00
stat_tap_ui.c stat_tap_table_ui: create tables only once during init 2021-01-28 13:41:08 +00:00
stat_tap_ui.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
stats_tree.c Detect and replace bad allocation patterns (more) 2020-12-23 14:07:18 +00:00
stats_tree.h
stats_tree_priv.h
stream.c
stream.h
strutil.c epan: Fix format_text treament of Greek, Arabic, etc. 2020-12-09 12:51:19 +00:00
strutil.h Add format_text_string(), which gets the length with strlen(). 2020-08-20 07:24:32 +00:00
t35.c
t35.h
tap-voip.h
tap.c Avoid exposing HAVE_PLUGINS in the public API 2021-02-06 16:35:51 +00:00
tap.h Avoid exposing HAVE_PLUGINS in the public API 2021-02-06 16:35:51 +00:00
tfs.c GTPv2: Update IE 8.12 Indication 2020-12-17 12:35:01 +00:00
tfs.h GTPv2: Update IE 8.12 Indication 2020-12-17 12:35:01 +00:00
time_fmt.h
timestamp.c
timestamp.h
timestats.c
timestats.h
to_str-int.h
to_str.c Cast away the return value of g_strlcpy() and g_strlcat(). 2021-04-30 03:19:19 -07:00
to_str.h Handle relative times with >2^31 seconds. 2020-10-18 02:06:07 -07:00
tvbparse.c Replace more g_malloc with g_new 2020-12-23 11:47:17 +00:00
tvbparse.h
tvbtest.c tvbtest: Test offsets returned by tvb_find on subsets. 2021-04-03 15:12:20 +00:00
tvbuff-int.h
tvbuff.c epan: redo the processing of ENC_APN_STR. 2021-05-21 16:32:28 -07:00
tvbuff.h http: Add dissection of HTTP2-Settings 2021-05-08 17:14:45 +00:00
tvbuff_base64.c http: Add dissection of HTTP2-Settings 2021-05-08 17:14:45 +00:00
tvbuff_brotli.c
tvbuff_composite.c
tvbuff_lz77.c
tvbuff_lz77huff.c
tvbuff_lznt1.c
tvbuff_real.c
tvbuff_subset.c tvbuff_subset: fix its implementation of string scanning. 2021-03-29 01:02:47 +00:00
tvbuff_zlib.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
uat-int.h
uat.c UAT: Adding support for uint64 (dec/hex), int64 (dec) 2021-01-05 11:20:47 +00:00
uat.h wsutils: add local implementation of g_memdup2. 2021-03-25 09:38:10 +00:00
uat_load.l
unit_strings.c
unit_strings.h
value_string.c
value_string.h Move more headers outside extern "C". 2021-03-16 02:36:10 -07:00
ws_printf.h Add ws_debug() and use it 2021-05-24 01:13:19 +00:00
x264_prt_id.h
xdlc.c
xdlc.h