2 * UCW Library Utilities -- A Simple Logger for use in shell scripts
4 * (c) 2001--2009 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
17 main(int argc, char **argv)
22 if (argc < 3 || argc > 4 || strlen(argv[2]) != 1)
23 die("Usage: logger [<logname>:]<progname> <level> [<text>]");
24 if (c = strchr(argv[1], ':'))
34 while (level < L_MAX && LS_LEVEL_LETTER(level) != argv[2][0])
37 die("Unknown logging level `%s'", argv[2]);
42 while (fgets(buf, sizeof(buf), stdin))
44 c = strchr(buf, '\n');