00001 /* 00002 * OstreamAppender.hh 00003 * 00004 * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. 00005 * Copyright 2000, Bastiaan Bakker. All rights reserved. 00006 * 00007 * See the COPYING file for the terms of usage and distribution. 00008 */ 00009 00010 #ifndef _LOG4CPP_OSTREAMAPPENDER_HH 00011 #define _LOG4CPP_OSTREAMAPPENDER_HH 00012 00013 #include <log4cpp/Portability.hh> 00014 #include <string> 00015 #include <iostream> 00016 #include <log4cpp/LayoutAppender.hh> 00017 00018 namespace log4cpp { 00019 00023 class LOG4CPP_EXPORT OstreamAppender : public LayoutAppender { 00024 public: 00025 OstreamAppender(const std::string& name, std::ostream* stream); 00026 virtual ~OstreamAppender(); 00027 00028 virtual bool reopen(); 00029 virtual void close(); 00030 00031 protected: 00032 virtual void _append(const LoggingEvent& event); 00033 00034 std::ostream* _stream; 00035 }; 00036 } 00037 00038 #endif // _LOG4CPP_OSTREAMAPPENDER_HH