OstreamAppender.hh 877 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * OstreamAppender.hh
  3. *
  4. * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
  5. * Copyright 2000, Bastiaan Bakker. All rights reserved.
  6. *
  7. * See the COPYING file for the terms of usage and distribution.
  8. */
  9. #ifndef _LOG4CPP_OSTREAMAPPENDER_HH
  10. #define _LOG4CPP_OSTREAMAPPENDER_HH
  11. #include <log4cpp/Portability.hh>
  12. #include <string>
  13. #include <iostream>
  14. #include <log4cpp/LayoutAppender.hh>
  15. LOG4CPP_NS_BEGIN
  16. /**
  17. * OstreamAppender appends LoggingEvents to ostreams.
  18. **/
  19. class LOG4CPP_EXPORT OstreamAppender : public LayoutAppender {
  20. public:
  21. OstreamAppender(const std::string& name, std::ostream* stream);
  22. virtual ~OstreamAppender();
  23. virtual bool reopen();
  24. virtual void close();
  25. protected:
  26. virtual void _append(const LoggingEvent& event);
  27. std::ostream* _stream;
  28. };
  29. LOG4CPP_NS_END
  30. #endif // _LOG4CPP_OSTREAMAPPENDER_HH