Home Projects Jobs Clientele Contact


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

Re: Log class problems

In my method, one would need to override single function just as well.
Most of your current overflow() code would stay the same - just the
virtual saveLog() function would need to be overwritten. This isn't
any more complex then what you propose.

There are reasons, why C++ iostreams are designed the way they are.
In the design I'm proposing one wouldn't need to derive from CLogStream
_at all_. There would be singel CLogStream class, that provides intrfaces
for setting log priorities and stuff like that, that are common to all log
classes, and then it would be used with different buffers for different

(This is slight deviation from my original thinking, where I didn't realize
there is no need to further derive CLogStream)

Alexey Parshin wrote:

>2. I gave you my arguments. Writing a new log class is much simplier in the
>current implementation. Considering that I'm not trading off anything -
>that's enough. To add even more - I don't want to explain in documentation -
>"don't you dare to overwrite overflow(), or it would stop working!". Current
>implementation requires to ovewrite a single method with a parameters
>providing full info about what should be done. That's an idiot-proof method.

Ilya A. Volynets-Evenbakh
Total Knowledge. CTO

Authoright © Total Knowledge: 2001-2008