LogPrintf.cpp 877 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * File: Os/LogPrintf.cpp
  3. * Description: an implementation on the Os::Log abstraction that routes log messages into standard
  4. * printf calls.
  5. */
  6. #include <Os/Log.hpp>
  7. #include <cstdio>
  8. namespace Os {
  9. Log::Log() {
  10. // Register myself as a logger at construction time. If used in unison with LogDefault.cpp, this will
  11. // automatically create this as a default logger.
  12. this->registerLogger(this);
  13. }
  14. // Instance implementation
  15. void Log::log(
  16. const char* fmt,
  17. POINTER_CAST a0,
  18. POINTER_CAST a1,
  19. POINTER_CAST a2,
  20. POINTER_CAST a3,
  21. POINTER_CAST a4,
  22. POINTER_CAST a5,
  23. POINTER_CAST a6,
  24. POINTER_CAST a7,
  25. POINTER_CAST a8,
  26. POINTER_CAST a9
  27. ) {
  28. (void) printf(fmt, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
  29. (void) fflush(stdout);
  30. }
  31. }