mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00

This can be handy when oen doesn't want any output but still get access to filter functionality, including rotation; and also for general testing.
30 lines
852 B
C++
30 lines
852 B
C++
// See the file "COPYING" in the main distribution directory for copyright.
|
|
//
|
|
// Dummy log writer that just discards everything (but still pretends to rotate).
|
|
|
|
#ifndef LOGWRITERNONE_H
|
|
#define LOGWRITERNONE_H
|
|
|
|
#include "LogWriter.h"
|
|
|
|
class LogWriterNone : public LogWriter {
|
|
public:
|
|
LogWriterNone() {}
|
|
~LogWriterNone() {};
|
|
|
|
static LogWriter* Instantiate() { return new LogWriterNone; }
|
|
|
|
protected:
|
|
virtual bool DoInit(string path, int num_fields,
|
|
const LogField* const * fields) { return true; }
|
|
|
|
virtual bool DoWrite(int num_fields, const LogField* const * fields,
|
|
LogVal** vals) { return true; }
|
|
virtual bool DoSetBuf(bool enabled) { return true; }
|
|
virtual bool DoRotate(string rotated_path, double open, double close,
|
|
bool terminating);
|
|
virtual bool DoFlush() { return true; }
|
|
virtual void DoFinish() {}
|
|
};
|
|
|
|
#endif
|