1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/misc
Peter Rajnoha 06ce9b4e42 log: separate output and make it possible to use given FDs
Currently, the output is separated in 3 parts and each part can go into
a separate and user-defined file descriptor:

  - common output (stdout by default, customizable by LVM_OUT_FD environment variable)
  - error output (stderr by default, customizable by LVM_ERR_FD environment variable)
  - report output (stdout by default, customizable by LVM_REPORT_FD environment variable)

For example, each type of output goes to different output file:

  [0] fedora/~ # export LVM_REPORT_FD=3

  [0] fedora/~ # lvs fedora vg/abc 1>out 2>err 3>report

  [0] fedora/~ # cat out

  [0] fedora/~ # cat err
    Volume group "vg" not found
    Cannot process volume group vg

  [0] fedora/~ # cat report
    LV   VG     Attr       LSize   Layout     Role       CTime
    root fedora -wi-ao----  19.00g linear     public     Wed May 27 2015 08:09:21
    swap fedora -wi-ao---- 500.00m linear     public     Wed May 27 2015 08:09:21

Another example in LVM shell where the report goes to "report" file:

  [0] fedora/~ # export LVM_REPORT_FD=3
  [0] fedora/~ # lvm 3>report

  (in lvm shell)
  lvm> vgs

  (content of "report" file)
  [1] fedora/~ # cat report
    VG     #PV #LV #SN Attr   VSize  VFree
    fedora   1   2   0 wz--n- 19.49g    0

  (in lvm shell)
  lvm> lvs

  (content of "report" file)
  [1] fedora/~ # cat report
    VG     #PV #LV #SN Attr   VSize  VFree
    fedora   1   2   0 wz--n- 19.49g    0
    LV   VG     Attr       LSize   Layout     Role       CTime
    root fedora -wi-ao----  19.00g linear     public     Wed May 27 2015 08:09:21
    swap fedora -wi-ao---- 500.00m linear     public     Wed May 27 2015 08:09:21
2016-08-09 18:24:45 +02:00
..
crc_gen.c doc: change fsf address 2016-01-21 12:11:37 +01:00
crc.c doc: change fsf address 2016-01-21 12:11:37 +01:00
crc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
intl.h doc: change fsf address 2016-01-21 12:11:37 +01:00
last-path-component.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lib.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-exec.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-exec.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-file.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-file.h log: separate output and make it possible to use given FDs 2016-08-09 18:24:45 +02:00
lvm-flock.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-flock.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-globals.c vgimportclone: add native command 2016-06-22 13:13:10 -05:00
lvm-globals.h vgimportclone: add native command 2016-06-22 13:13:10 -05:00
lvm-percent.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-percent.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-signal.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-signal.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-string.c string: Add first_substring(). 2016-07-14 14:46:38 +01:00
lvm-string.h string: Add first_substring(). 2016-07-14 14:46:38 +01:00
lvm-wrappers.c fix: make udev_get_library_context available also for non-udev compilations 2016-04-01 15:35:22 +02:00
lvm-wrappers.h fix: make udev_get_library_context available also for non-udev compilations 2016-04-01 15:35:22 +02:00
sharedlib.c coverity: check for zero length buffer 2016-02-23 21:40:16 +01:00
sharedlib.h doc: change fsf address 2016-01-21 12:11:37 +01:00
util.h lvconvert: Conversions between striped and raid0. 2016-06-28 23:44:15 +01:00