filelogger.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * @file log.h
  3. * Furi Logging system
  4. */
  5. #pragma once
  6. #include <core/log.h>
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /** Initialize logging */
  11. void file_log_init();
  12. void file_log_deinit();
  13. /** Print log record
  14. *
  15. * @param level
  16. * @param tag
  17. * @param format
  18. * @param ...
  19. */
  20. void file_log_print_format(FuriLogLevel level, const char* tag, const char* format, ...)
  21. _ATTRIBUTE((__format__(__printf__, 3, 4)));
  22. // /** Set log level
  23. // *
  24. // * @param[in] level The level
  25. // */
  26. // void file_log_set_level(FuriLogLevel level);
  27. // /** Get log level
  28. // *
  29. // * @return The furi log level.
  30. // */
  31. // FuriLogLevel file_log_get_level();
  32. // /** Set log output callback
  33. // *
  34. // * @param[in] puts The puts callback
  35. // */
  36. // void file_log_set_puts(FuriLogPuts puts);
  37. /** Set timestamp callback
  38. *
  39. * @param[in] timestamp The timestamp callback
  40. */
  41. void file_log_set_timestamp(FuriLogTimestamp timestamp);
  42. /** Log methods
  43. *
  44. * @param tag The application tag
  45. * @param format The format
  46. * @param ... VA Args
  47. */
  48. #define FILE_LOG_E(tag, format, ...) \
  49. file_log_print_format(FuriLogLevelError, tag, format, ##__VA_ARGS__)
  50. #define FILE_LOG_W(tag, format, ...) \
  51. file_log_print_format(FuriLogLevelWarn, tag, format, ##__VA_ARGS__)
  52. #define FILE_LOG_I(tag, format, ...) \
  53. file_log_print_format(FuriLogLevelInfo, tag, format, ##__VA_ARGS__)
  54. #define FILE_LOG_D(tag, format, ...) \
  55. file_log_print_format(FuriLogLevelDebug, tag, format, ##__VA_ARGS__)
  56. #define FILE_LOG_T(tag, format, ...) \
  57. file_log_print_format(FuriLogLevelTrace, tag, format, ##__VA_ARGS__)
  58. #ifdef __cplusplus
  59. }
  60. #endif