std::iostream help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings...

I need a wrapper to use around std::iostream...

Right now, I have this:

std::iostream debug_out;

And I use it the same way you¹d use std::cout...

Debug_out << ³Debug Message² << std::endl;

And it works fine.

But, debug_out gets used in millions of places in my code, so, somehow I
need to come up with a wrapper around the std::iostream to check the debug
level...  I realize the below isn¹t valid code (I tried) but, will give and
idea of what I want to do:

U_short TH_ALGO_DEBUG = 0;

If (TH_ALGO_DEBUG > 0) {
    std::iostream debug_out;
}

So I want debug_out to only with if debug is greater than zero; without
having to change the debug_out call in millions of places in my code?!?!?!

Please help!

-b



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux