log_test.c 698 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <unistd.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <stddef.h>
  5. #include <stdarg.h>
  6. #include <ctype.h>
  7. #include <string.h>
  8. #include <signal.h>
  9. #include <sys/file.h>
  10. #include <sys/dir.h>
  11. #include <sys/stat.h>
  12. #include <time.h>
  13. #include <sys/time.h>
  14. #include "ab_code.h"
  15. #include "log.h"
  16. int main(int argc, char *argv[])
  17. {
  18. set_log_filename("./logs/test[PID][YYYY][MM][DD].txt");
  19. set_log_keephours(1);
  20. set_log_stdout(1);
  21. log_trace("log trace ok");
  22. log_set_level(LOG_DEBUG);
  23. log_trace("log trace ------- ERROR!");
  24. log_debug("log debug ok");
  25. log_info("log info ok");
  26. log_warn("log warn ok");
  27. log_error("log error ok");
  28. return 0;
  29. }