log.c 509 B

12345678910111213141516171819202122232425
  1. #define _GNU_SOURCE
  2. #include <stdio.h>
  3. #include <stdarg.h>
  4. #include <string.h>
  5. #include "log.h"
  6. #include "flipper.h"
  7. #define PRINT_STR_SIZE 64
  8. void fuprintf(FuriRecordSubscriber* f, const char* format, ...) {
  9. char buffer[PRINT_STR_SIZE];
  10. va_list args;
  11. va_start(args, format);
  12. vsprintf(buffer, format, args);
  13. va_end(args);
  14. furi_write(f, buffer, strlen(buffer));
  15. }
  16. FuriRecordSubscriber* get_default_log() {
  17. return furi_open_deprecated("tty", false, false, NULL, NULL, NULL);
  18. }