hello.c 635 B

12345678910111213141516171819202122
  1. #define ZF_LOG_LEVEL ZF_LOG_INFO
  2. #define ZF_LOG_TAG "MAIN"
  3. #include <zf_log.h>
  4. int main(int argc, char *argv[])
  5. {
  6. zf_log_set_tag_prefix("hello");
  7. ZF_LOGI("You will see the number of arguments: %i", argc);
  8. ZF_LOGD("You will NOT see the first argument: %s", *argv);
  9. zf_log_set_output_level(ZF_LOG_WARN);
  10. ZF_LOGW("You will see this WARNING message");
  11. ZF_LOGI("You will NOT see this INFO message");
  12. const char data[] =
  13. "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
  14. "Aliquam pharetra orci id velit porttitor tempus.";
  15. ZF_LOGW_MEM(data, sizeof(data), "Lorem ipsum at %p:", (const void *) data);
  16. return 0;
  17. }