]> git.ozlabs.org Git - ccan/blob - ccan/pr_log/_info
7f4feb646508d8e0c43483a310141ac872679731
[ccan] / ccan / pr_log / _info
1 #include <string.h>
2 #include "config.h"
3
4 /**
5  * pr_log - print things with varying levels of importance
6  *
7  * pr_log is a "logger" styled similarly to Linux's printk() and pr_*() macros.
8  * The amount of debug output is controlled by the value of the `DEBUG`
9  * environment variable.
10  *
11  * It provides work-alikes for Linux's pr_devel, pr_debug, pr_info, etc macros.
12  *
13  * Example:
14  *      #include <ccan/pr_log/pr_log.h>
15  *
16  *      int main(int argc, char *argv[])
17  *      {
18  *              pr_debug("It's working\n");
19  *              pr_info("Really, it works\n");
20  *              pr_emerg("I'm serious %d\n", argc);
21  *              return 0;
22  *      }
23  *
24  * License: LGPL (v2.1 or any later version)
25  * Author: Cody P Schafer <dev@codyps.com>
26  */
27 int main(int argc, char *argv[])
28 {
29         /* Expect exactly one argument */
30         if (argc != 2)
31                 return 1;
32
33         if (strcmp(argv[1], "depends") == 0) {
34                 printf("ccan/compiler\n");
35                 printf("ccan/str\n");
36                 return 0;
37         }
38
39         return 1;
40 }