Include file information in input reader error messages

This commit is contained in:
Tim Wojtulewicz 2021-12-09 12:08:33 -07:00
parent 8184073ef8
commit 098a5d3348
13 changed files with 179 additions and 57 deletions

View file

@ -8,6 +8,11 @@
#include "zeek/threading/BasicThread.h"
#include "zeek/threading/Queue.h"
namespace zeek::detail
{
class Location;
}
namespace zeek::threading
{
@ -275,6 +280,17 @@ protected:
void OnSignalStop() override;
void OnKill() override;
/**
* Method for child classes to override to provide file location
* information in log messages. This is primarily used by the input
* framework's ReaderBackend classes to give more descriptive error
* messages.
*
* @return A Location pointer containing the file location information,
* or nullptr if nothing is available.
*/
virtual zeek::detail::Location* GetLocationInfo() const { return nullptr; }
private:
/**
* Pops a message sent by the main thread from the main-to-chold