Stream Q

W

Wouter Lievens

I know I can change the behaviour of the clog object to, for example, log to
a file, using rdbuf().
Can I change it to do both, meaning dumping to a file and writing to the
console.

So I mean, if I call:

clog << "Foobar" << endl;

It should write it to the console and write it to a file.
 
W

Wouter Lievens

Victor Bazarov said:
log

Of course. You just need to implement your own streambuf that
would combine the other two.

Victor

Came up with that, doing it now :)
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top