logging_event.c 1.0 KB

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