Sorry. I realized this is a stupid question - std::left and std::setw() can
be used directly with log4cxx.


On Fri, Jan 24, 2014 at 9:14 AM, Wang Danqi <beyond...@gmail.com> wrote:

> Hi all
>
> My problem is that I have the following code:
>
> std::string filename;size_t size;
> cout << "Loading file " < std::left << std::setw(15) << filename << '\tsize:" 
> << size <<endl;
>
> I want to modify it to use LOG4CXX:
>
> LOG_INFO(logger, "Loading file " << filename << '\tsize:" << size);
>
> I don't know how to set the width of filename to 15 and align to left in
> log4cxx though.
>
> I find that in the code of log4cxx: src/main/include/log4cxx/stream.hline 70:
>
> /**
> *   set width.  This should be used in preference to inserting an std::setw(n)
> *   since the other requires construction of an STL stream which may be 
> expensive.
> */int width(int newval);
>
> which looks like what I want. But I am not sure about how to use it.
> Thank you.
>
> --
> Best wishes,
>
> Wang Danqi
>



-- 
Best wishes,

Wang Danqi

Reply via email to