|
Boost Users : |
Subject: Re: [Boost-users] [log] Sink format is ignored
From: VÃctor Yo (rcpoetics_at_[hidden])
Date: 2013-12-06 09:13:23
>From the manual pages I guess you could make
boost::shared_ptr< file_sink > sink(new file_sink(backend));
when you want to wrap the backend in the frontend and make it works.
Anyway, when I made my logger I used the other form, creating a formatter
object and registering in the sink frontend
file_sink -> set_formatter(fmt);
El miércoles, 4 de diciembre de 2013 15:50:25 UTC+1, Igor R escribió:
>
> Hello,
>
> I'm setting up a sink like this:
>
> boost::shared_ptr<sinks::text_file_backend> backend =
> boost::make_shared<sinks::text_file_backend>
> (
> keywords::file_name = fileName,
> keywords::rotation_size = maxSize,
> keywords::format = "[%TimeStamp%][%LineID%]: %Message%",
> keywords::auto_flush = true
> );
>
> typedef sinks::synchronous_sink<sinks::text_file_backend> file_sink;
> boost::shared_ptr<file_sink> sink =
> boost::make_shared<file_sink>(backend);
> sink->set_filter(!expr::has_attr(serv_attr));
> logging::core::get()->add_sink(sink);
> logging::add_common_attributes();
>
>
> However, it seems that keywords::format parameter is just ignored.
> What am I doing wrong?
> _______________________________________________
> Boost-users mailing list
> Boost..._at_[hidden] <javascript:>
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net