wireshark/capture
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
..
.editorconfig
CMakeLists.txt
airpcap.h
airpcap_loader.c
airpcap_loader.h
capture-pcap-util-int.h
capture-pcap-util-unix.c Minor style change to libpcap version string 2021-05-27 17:40:01 +00:00
capture-pcap-util.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
capture-pcap-util.h
capture-wpcap.c
capture-wpcap.h
capture_ifinfo.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
capture_ifinfo.h
capture_session.h
capture_sync.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
capture_sync.h
capture_win_ifnames.c Refactor our logging and extend the wslog API 2021-06-11 09:40:28 +00:00
capture_win_ifnames.h
iface_monitor.c
iface_monitor.h
ws80211_utils.c Cast away the return value of g_strlcpy() and g_strlcat(). 2021-04-30 03:19:19 -07:00
ws80211_utils.h