LoggingEvent.hh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. LOG4CPP_NS_BEGIN
  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. private:
  58. LoggingEvent & operator=(const LoggingEvent &);
  59. };
  60. LOG4CPP_NS_END
  61. #endif // _LOG4CPP_LOGGINGEVENT_HH