logging_event.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. static const char version[] = "$Id$";
  2. /*
  3. * logging_event.c
  4. *
  5. * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
  6. *
  7. * See the COPYING file for the terms of usage and distribution.
  8. */
  9. #include <log4c/logging_event.h>
  10. #include <log4c/category.h>
  11. #include <stdlib.h>
  12. #include <sd/malloc.h>
  13. #include <sd/sd_xplatform.h>
  14. /*******************************************************************************/
  15. extern log4c_logging_event_t* log4c_logging_event_new(
  16. const char* a_category,
  17. int a_priority,
  18. const char* a_message)
  19. {
  20. log4c_logging_event_t* evt;
  21. evt = (log4c_logging_event_t*)sd_calloc(1, sizeof(log4c_logging_event_t));
  22. evt->evt_category = a_category;
  23. evt->evt_priority = a_priority;
  24. evt->evt_msg = a_message;
  25. SD_GETTIMEOFDAY(&evt->evt_timestamp, NULL);
  26. return evt;
  27. }
  28. /*******************************************************************************/
  29. extern void log4c_logging_event_delete(log4c_logging_event_t* ptrThis)
  30. {
  31. if (!ptrThis)
  32. return;
  33. free(ptrThis);
  34. }