AbortAppender.hh 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * AbortAppender.hh
  3. *
  4. * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
  5. * Copyright 2002, Bastiaan Bakker. All rights reserved.
  6. *
  7. * See the COPYING file for the terms of usage and distribution.
  8. */
  9. #ifndef _LOG4CPP_ABORTAPPENDER_HH
  10. #define _LOG4CPP_ABORTAPPENDER_HH
  11. #include <log4cpp/Portability.hh>
  12. #include <log4cpp/AppenderSkeleton.hh>
  13. LOG4CPP_NS_BEGIN
  14. /**
  15. * This Appender causes the application to abort() upon the first append()
  16. * call.
  17. *
  18. * @since 0.3.5
  19. **/
  20. class LOG4CPP_EXPORT AbortAppender : public AppenderSkeleton {
  21. public:
  22. AbortAppender(const std::string& name);
  23. virtual ~AbortAppender();
  24. virtual bool reopen();
  25. virtual void close();
  26. /**
  27. * The AbortAppender does not layout.
  28. * @returns false
  29. **/
  30. virtual bool requiresLayout() const;
  31. virtual void setLayout(Layout* layout);
  32. protected:
  33. virtual void _append(const LoggingEvent& event);
  34. };
  35. LOG4CPP_NS_END
  36. #endif // _LOG4CPP_ABORTAPPENDER_HH