Layout.hh 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Layout.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_LAYOUT_HH
  10. #define _LOG4CPP_LAYOUT_HH
  11. #include <log4cpp/Portability.hh>
  12. #include <log4cpp/LoggingEvent.hh>
  13. #include <string>
  14. LOG4CPP_NS_BEGIN
  15. /**
  16. * Extend this abstract class to create your own log layout format.
  17. **/
  18. class LOG4CPP_EXPORT Layout {
  19. public:
  20. /**
  21. * Destructor for Layout.
  22. **/
  23. virtual ~Layout() { };
  24. /**
  25. * Formats the LoggingEvent data to a string that appenders can log.
  26. * Implement this method to create your own layout format.
  27. * @param event The LoggingEvent.
  28. * @returns an appendable string.
  29. **/
  30. virtual std::string format(const LoggingEvent& event) = 0;
  31. };
  32. LOG4CPP_NS_END
  33. #endif // _LOG4CPP_LAYOUT_HH