LoggingEvent.hh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * LoggingEvent.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_LOGGINGEVENT_HH
  10. #define _LOG4CPP_LOGGINGEVENT_HH
  11. #include <log4cpp/Portability.hh>
  12. #include <string>
  13. #include <log4cpp/Priority.hh>
  14. #include <log4cpp/TimeStamp.hh>
  15. /**
  16. * The top level namespace for all 'Log for C++' types and classes.
  17. **/
  18. namespace log4cpp {
  19. /**
  20. * The internal representation of logging events. When a affirmative
  21. * logging decision is made a <code>LoggingEvent</code> instance is
  22. * created. This instance is passed around the different log4cpp
  23. * components.
  24. *
  25. * <p>This class is of concern to those wishing to extend log4cpp.
  26. **/
  27. struct LOG4CPP_EXPORT LoggingEvent {
  28. public:
  29. /**
  30. * Instantiate a LoggingEvent from the supplied parameters.
  31. *
  32. * <p>Except <code>timeStamp</code> all the other fields of
  33. * <code>LoggingEvent</code> are filled when actually needed.
  34. * <p>
  35. * @param category The category of this event.
  36. * @param message The message of this event.
  37. * @param ndc The nested diagnostic context of this event.
  38. * @param priority The priority of this event.
  39. **/
  40. LoggingEvent(const std::string& category, const std::string& message,
  41. const std::string& ndc, Priority::Value priority);
  42. /** The category name. */
  43. const std::string categoryName;
  44. /** The application supplied message of logging event. */
  45. const std::string message;
  46. /** The nested diagnostic context (NDC) of logging event. */
  47. const std::string ndc;
  48. /** Priority of logging event. */
  49. Priority::Value priority;
  50. /** The name of thread in which this logging event was generated,
  51. e.g. the PID.
  52. */
  53. const std::string threadName;
  54. /** The number of seconds elapsed since the epoch
  55. (1/1/1970 00:00:00 UTC) until logging event was created. */
  56. TimeStamp timeStamp;
  57. };
  58. }
  59. #endif // _LOG4CPP_LOGGINGEVENT_HH