Layout.hh 978 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. namespace log4cpp {
  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. }
  33. #endif // _LOG4CPP_LAYOUT_HH