chenBright commented on issue #2696:
URL: https://github.com/apache/brpc/issues/2696#issuecomment-2241989426

   Make LogStream a virtual base class as follows:
   
   ```c++
   class LogStream :  public std::ostream {
       LogStream(std::streambuf& streambuf) : std::ostream(&streambuf) {}
       virtual void SetSourceLocation(const SourceLocation& sl) = 0;
       virtual void Flush() = 0;
   }
   ```
   
   At the same time, a `LogStreamFactory` is needed to create` LogStream` 
instances, as follows:
   
   ```c++
   
   class LogStreamFactory {
       virtual LogStream* Create() = 0;
       virtual void Destroy(LogStream* log_stream) = 0;
   };
   ```
   
   Is this design feasible?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to