priority.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* $Id$
  2. *
  3. * priority.h
  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. #ifndef log4c_priority_h
  10. #define log4c_priority_h
  11. /**
  12. * @file priority.h
  13. *
  14. * @brief The priority class provides importance levels with which one can
  15. * categorize log messages.
  16. **/
  17. #include <log4c/defs.h>
  18. __LOG4C_BEGIN_DECLS
  19. /**
  20. * Predefined Levels of priorities. These correspond to the priority levels
  21. * used by syslog(3).
  22. **/
  23. typedef enum {
  24. /** fatal */ LOG4C_PRIORITY_FATAL = 000,
  25. /** alert */ LOG4C_PRIORITY_ALERT = 100,
  26. /** crit */ LOG4C_PRIORITY_CRIT = 200,
  27. /** error */ LOG4C_PRIORITY_ERROR = 300,
  28. /** warn */ LOG4C_PRIORITY_WARN = 400,
  29. /** notice */ LOG4C_PRIORITY_NOTICE = 500,
  30. /** info */ LOG4C_PRIORITY_INFO = 600,
  31. /** debug */ LOG4C_PRIORITY_DEBUG = 700,
  32. /** trace */ LOG4C_PRIORITY_TRACE = 800,
  33. /** notset */ LOG4C_PRIORITY_NOTSET = 900,
  34. /** unknown */ LOG4C_PRIORITY_UNKNOWN = 1000
  35. } log4c_priority_level_t;
  36. /**
  37. * @param a_priority a numeric value of the priority.
  38. * @returns the given priority string name.
  39. **/
  40. LOG4C_API const char* log4c_priority_to_string(int a_priority);
  41. /**
  42. * @param a_priority_name a priority string name.
  43. * @returns the given numeric value of the priority.
  44. **/
  45. LOG4C_API int log4c_priority_to_int(const char* a_priority_name);
  46. __LOG4C_END_DECLS
  47. #endif