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