25 #include "../common.hpp"
27 #include "../types/config.hpp"
28 #include "../plugin.hpp"
33 namespace swarm {
namespace log {
42 std::auto_ptr<std::ostream> output;
43 std::string rawfn, binfn;
49 binfn = cfg.at(
"log_output");
51 ERROR(
"Expected filename for writer.")
52 rawfn = binfn +
".raw";
54 output.reset(
new std::ofstream(rawfn.c_str()));
56 ERROR(
"Could not open '" + rawfn +
"' for writing");
59 swarm::swarm_header fh(query::UNSORTED_HEADER_FULL);
60 output->write((
char*)&fh,
sizeof(fh));
74 unlink(rawfn.c_str());
82 virtual void process(
const char *log_data,
size_t length)
85 output->write(log_data, length);