hlog_test.c 531 B

12345678910111213141516171819202122
  1. #include "hlog.h"
  2. int main(int argc, char* argv[]) {
  3. char logfile[] = "hlog_test.log";
  4. hlog_set_file(logfile);
  5. hlog_set_level(LOG_LEVEL_INFO);
  6. // test log max filesize
  7. hlog_set_max_filesize_by_str("1M");
  8. for (int i = 100000; i <= 999999; ++i) {
  9. hlogi("[%d] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", i);
  10. }
  11. // test log level
  12. hlogd("%s", "not show debug");
  13. hlogi("%s", "show info");
  14. hlogw("%s", "show warn");
  15. hloge("%s", "show error");
  16. hlogf("%s", "show fatal");
  17. return 0;
  18. }