Custom ostream for a println-like function
I'll review more later but a basic comment first.

Rather than write just the println_buf class I would also write the println_stream class that internally has a println_buf.

class println_stream: std::ostream
{
    // Make this a private class.
    // You don't need to leak implementation details.
    // As far as anybody else is convered it is just std::streambuf
    class println_buf { /* STUFF */ };

    println_buf     buf;
    std::streambuf* oldBuf = nullptr;
    public:
        println_stream()
            // You can't pass the buf to the ostream constructor
            // here as it has not been constructed yet.
            // There are ways but lets keep it simple for now.
        {
            // I did not do the work with logfunc
            // Have not read that bit yet.
            // But you get the idea I hope.
            oldBuf = rdbuf(&amp;buf);
        }
        ~println_stream()
        {
            // Can't remember if it is required.
            // But I would always set back the original buffer.
            rdbuf(oldBuf);
        }
};

int main()
{
   println_stream stream;
    stream &lt;&lt; "Hello world\n";
}