test_externally_defined_state_cpp.cpp 646 B

12345678910111213141516171819202122232425
  1. #define ZF_LOG_EXTERN_TAG_PREFIX
  2. #define ZF_LOG_EXTERN_GLOBAL_FORMAT
  3. #define ZF_LOG_EXTERN_GLOBAL_OUTPUT
  4. #define ZF_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL
  5. #include <zf_log.c>
  6. ZF_LOG_DEFINE_TAG_PREFIX = "MAIN";
  7. ZF_LOG_DEFINE_GLOBAL_FORMAT = {32};
  8. ZF_LOG_DEFINE_GLOBAL_OUTPUT = {ZF_LOG_OUT_STDERR};
  9. ZF_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = ZF_LOG_INFO;
  10. namespace
  11. {
  12. void mock_output_callback(const zf_log_message *, void *)
  13. {
  14. }
  15. }
  16. int main(int argc, char *argv[])
  17. {
  18. zf_log_set_output_v(ZF_LOG_PUT_STD, 0, mock_output_callback);
  19. ZF_LOGI("log from cpp, argc=%i", argc);
  20. ZF_LOGI_MEM(argv, argc * sizeof(*argv), "log from cpp, argv pointers:");
  21. return 0;
  22. }