[LLVMdev] [PATCH] Circular Buffered Debug Stream

David Greene dag at cray.com
Fri Dec 18 17:32:29 PST 2009


On Friday 18 December 2009 19:24, Chris Lattner wrote:

> > No, this is what gets dumped at program termination.  Remember, this
> > stream
> > buffers everything you send it, effectively dropping everything
> > except the
> > last N characters, when N == BufferSize.  Then at program
> > termination it
> > dumps the buffer.
>
> Aha, ok.  So the usage model is that it normally is unbuffered and
> pass through like errs(), but you can pass a flag that causes all the -
> debug output to be circular buffered?

Right!

> > logs() might be a better name than dbgs() for this.  What do you
> > think?
>
> If it writes out to stderr, I think dbgs() is a better name, logs()
> implies that it writes to a log file (at least to me).

Fair enough.

                              -Dave



More information about the llvm-dev mailing list