log.hpp 307 B

1234567891011121314
  1. #pragma once
  2. #include <stdio.h>
  3. #include <kernel/tty.hpp>
  4. #define kmsgf(fmt, ...) \
  5. if (1) {\
  6. char buf[512]; \
  7. snprintf(buf, sizeof(buf), fmt "\n" __VA_OPT__(,) __VA_ARGS__); \
  8. if (console) console->print(buf); \
  9. }
  10. #define kmsg(msg) if (console) console->print(msg "\n")