logger.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef __MONODROID_LOGGER_H__
  2. #define __MONODROID_LOGGER_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifndef ANDROID
  7. typedef enum android_LogPriority
  8. {
  9. ANDROID_LOG_UNKNOWN = 0,
  10. ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */
  11. ANDROID_LOG_VERBOSE,
  12. ANDROID_LOG_DEBUG,
  13. ANDROID_LOG_INFO,
  14. ANDROID_LOG_WARN,
  15. ANDROID_LOG_ERROR,
  16. ANDROID_LOG_FATAL,
  17. ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */
  18. } android_LogPriority;
  19. #endif
  20. // Keep in sync with Mono.Android/src/Runtime/Logger.cs!LogCategories enum
  21. typedef enum _LogCategories
  22. {
  23. LOG_NONE = 0,
  24. LOG_DEFAULT = 1 << 0,
  25. LOG_ASSEMBLY = 1 << 1,
  26. LOG_DEBUGGER = 1 << 2,
  27. LOG_GC = 1 << 3,
  28. LOG_GREF = 1 << 4,
  29. LOG_LREF = 1 << 5,
  30. LOG_TIMING = 1 << 6,
  31. LOG_BUNDLE = 1 << 7,
  32. LOG_NET = 1 << 8,
  33. LOG_NETLINK = 1 << 9,
  34. } LogCategories;
  35. #if 0
  36. extern unsigned int log_categories;
  37. #if DEBUG
  38. extern int gc_spew_enabled;
  39. #endif
  40. void init_categories(const char *override_dir);
  41. void log_error(LogCategories category, const char *format, ...);
  42. void log_fatal(LogCategories category, const char *format, ...);
  43. void log_info(LogCategories category, const char *format, ...);
  44. void log_warn(LogCategories category, const char *format, ...);
  45. void log_debug(LogCategories category, const char *format, ...);
  46. #else
  47. #define init_categories(override_dir)
  48. #define log_error(category, format, ...)
  49. #define log_fatal(category, format, ...)
  50. #define log_info(category, format, ...)
  51. #define log_warn(category, format, ...)
  52. #define log_debug(category, format, ...)
  53. #endif
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* __MONODROID_LOGGER_H__ */