New bif log_set_buf() to set the buffering state for a stream.

This commit is contained in:
Robin Sommer 2011-02-21 17:33:29 -08:00
parent 434f57f85f
commit cf148c8a25
8 changed files with 78 additions and 37 deletions

View file

@ -6,6 +6,7 @@ LogWriter::LogWriter()
{
buf = 0;
buf_len = 1024;
buffering = true;
}
LogWriter::~LogWriter()
@ -37,6 +38,16 @@ void LogWriter::Finish()
DoFinish();
}
bool LogWriter::SetBuf(bool enabled)
{
if ( enabled == buffering )
// No change.
return true;
buffering = enabled;
return DoSetBuf(enabled);
}
const char* LogWriter::Fmt(const char* format, ...)
{
if ( ! buf )