2 * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
4 * This file is part of LVM2.
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU General Public License v.2.
10 * You should have received a copy of the GNU General Public License
11 * along with this program; if not, write to the Free Software Foundation,
12 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 /* All output gets passed to this function line-by-line */
19 void test_log_fn(int level, const char *file, int line,
20 int dm_errno, const char *format)
22 /* Extract and process output here rather than printing it */
27 printf("%s\n", format);
31 int main(int argc, char **argv)
36 lvm2_log_fn(test_log_fn);
40 lvm2_log_level(handle, 1);
41 r = lvm2_run(handle, "vgs --noheadings vg1");
43 /* More commands here */