Use ws_g_warning() for plugin registration errors.

Those should always be reported, as they indicate that a block type
plugin is trying to do something we don't allow.

We should probably have a mechanism by which ws_g_warning() messages are
logged to the standard error for command-line programs, logged to an
error message window for GUI programs, and logged to some form of system
log for daemons.  For now, it's a good way to log non-fatal errors that
should always be shown in *some* fashion, as well as to mark messages
that should be handled in the form described in the previous sentence.

Change-Id: Ieedf87fc2dd3184a4466ae69af01f799165c1b70
Reviewed-on: https://code.wireshark.org/review/27519
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-05-13 23:05:12 -07:00
parent 6dedca3ece
commit 3a1bf2b87e
1 changed files with 5 additions and 4 deletions

View File

@ -21,6 +21,7 @@
#include <string.h>
#include <errno.h>
#include <wsutil/ws_printf.h>
#include "wtap-int.h"
#include "file_wrappers.h"
@ -251,8 +252,8 @@ register_pcapng_block_type_handler(guint block_type, block_reader reader,
* something we don't handle in that block, submit a change
* to the main Wireshark source).
*/
pcapng_debug("Attempt to register plugin for block type 0x%08x not allowed",
block_type);
ws_g_warning("Attempt to register plugin for block type 0x%08x not allowed",
block_type);
return;
case BLOCK_TYPE_IRIG_TS:
@ -275,8 +276,8 @@ register_pcapng_block_type_handler(guint block_type, block_reader reader,
* No; don't allow a plugin to be registered for it, as
* the block type needs to be registered before it's used.
*/
pcapng_debug("Attempt to register plugin for reserved block type 0x%08x not allowed",
block_type);
ws_g_warning("Attempt to register plugin for reserved block type 0x%08x not allowed",
block_type);
return;
}