Boost logo

Boost :

Subject: Re: [boost] [log] Review-ready version in the Vault
From: Darryl Green (darryl.green_at_[hidden])
Date: 2009-02-16 09:21:33


On Mon, 2009-02-16 at 22:36 +1000, Darryl Green wrote:
> On Sun, 2009-02-15 at 12:31 +0300, Andrey Semashev wrote:
> > Darryl Green wrote:

> > > I don't see any particular difficulty in implementing such a sink?
> >
> > Technically, there may not be difficulties. But I don't think it's
> > reasonable.
>

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?


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