mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote branch 'origin/topic/robin/logging-internals'
Includes some additional cleanup.
This commit is contained in:
commit
13a492091f
119 changed files with 5266 additions and 183 deletions
55
src/LogWriterAscii.h
Normal file
55
src/LogWriterAscii.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
//
|
||||
// Log writer for delimiter-separated ASCII logs.
|
||||
|
||||
#ifndef LOGWRITERASCII_H
|
||||
#define LOGWRITERASCII_H
|
||||
|
||||
#include "LogWriter.h"
|
||||
|
||||
class LogWriterAscii : public LogWriter {
|
||||
public:
|
||||
LogWriterAscii();
|
||||
~LogWriterAscii();
|
||||
|
||||
static LogWriter* Instantiate() { return new LogWriterAscii; }
|
||||
|
||||
protected:
|
||||
virtual bool DoInit(string path, int num_fields,
|
||||
const LogField* const * fields);
|
||||
virtual bool DoWrite(int num_fields, const LogField* const * fields,
|
||||
LogVal** vals);
|
||||
virtual bool DoSetBuf(bool enabled);
|
||||
virtual bool DoRotate(string rotated_path, string postprocessr,
|
||||
double open, double close, bool terminating);
|
||||
virtual bool DoFlush();
|
||||
virtual void DoFinish();
|
||||
|
||||
private:
|
||||
bool IsSpecial(string path) { return path.find("/dev/") == 0; }
|
||||
bool DoWriteOne(ODesc* desc, LogVal* val, const LogField* field);
|
||||
|
||||
FILE* file;
|
||||
string fname;
|
||||
|
||||
// Options set from the script-level.
|
||||
bool output_to_stdout;
|
||||
bool include_header;
|
||||
|
||||
char* separator;
|
||||
int separator_len;
|
||||
|
||||
char* set_separator;
|
||||
int set_separator_len;
|
||||
|
||||
char* empty_field;
|
||||
int empty_field_len;
|
||||
|
||||
char* unset_field;
|
||||
int unset_field_len;
|
||||
|
||||
char* header_prefix;
|
||||
int header_prefix_len;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue