Boost logo

Boost :

Subject: Re: [boost] [log] Review-ready version in the Vault
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2009-02-16 12:54:02


Darryl Green wrote:

> I started trying to hack about the syslog sink to directly generate and
> send an RFC3164 message. I'm not quite sure how one should use the
> formatters and/or how to do a suitably general mapping of attributes to
> RFC3164 message fields. I need to do something like this:
>
> ostringstream ss;
> ss << "<" facility * 8 + level << ">" << fmt::date_time< types
>> ("DateTime", fmt::keywords::format = "%b %d %H:%M:%S")) << " " <<
> host_name << " " << program_name << ": " << formatted_message;
> std::string s = ss.str();
> send(sock, s.c_str(), s.size());
>
> Suggestions?

I think, the RFC3164 packet structure should not be achieved with
formatters, at least not those exposed to the user. The protocol is the
sink's implementation detail.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk