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