_info 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <ccan/log/log.h>
  2. /**
  3. * log - pretty-print logging information
  4. *
  5. * log is a set of functions and helper macros intended to make it easy to
  6. * pretty-print log entries.
  7. *
  8. * Example:
  9. * #include <ccan/log/log.h>
  10. *
  11. * int main(int argc, char *argv[])
  12. * {
  13. * print_log(LOG_INFO, "This is an info message.\n");
  14. * print_log(LOG_WARNING, "This is a warning message. It indicates that"
  15. * " an operation encountered minor issues\n");
  16. * print_log(LOG_ERROR, "This is an error message. It indicates that the\n"
  17. * "program could not complete an operation, but\n"
  18. * "that the error was not fatal. It might have\n"
  19. * "an error code, like so: %x\n", 0xDEADBEEF);
  20. * print_log(LOG_CRITICAL, "This is a critical message. It indicates\n"
  21. * "that the program had an unrecoverable error.\n");
  22. * set_log_mode(LOG_CONCISE);
  23. * print_log(LOG_INFO, "The symbol tags and information can be concise, as well.\n");
  24. * print_log(LOG_WARNING, "That was an info message. This is a warning message.\n");
  25. * print_log(LOG_ERROR, "And this is an error message.\n");
  26. * print_log(LOG_ERROR, "And this is a critical message.\n");
  27. * set_log_file("example.log");
  28. * print_log(LOG_INFO, "Logs can also be automatically printed to files.\n");
  29. *
  30. * Author: Henry Eshbaugh <henryeshbaugh@gmail.com>
  31. * License: MIT
  32. * Version: 1.0
  33. */
  34. int main(int argc, char *argv[])
  35. {
  36. if (argc != 2) return 1;
  37. if (strcmp(argv[1], "depends") == 0) return 0;
  38. return 1;
  39. }