0

gphoto2 often appends to its error messages a stanza of advice, which is helpful the first time but just gets in the way thereafter:

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

    env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --port
usb:002,035 -L A/store_00010001/DCIM/

Please make sure there is sufficient quoting around the arguments.

Can this be suppressed without brute force like these ways?

  • Wrap gphoto2 inside a /usr/local/bin/gphoto2, which filters its output.

  • Compile from source, and comment out that part.

  • gphoto2 --quiet, which suppresses too much.

4

1 回答 1

0

一位朋友翻阅了源代码。他发现错误去stderr,建议去stdout;所以建议(但不是错误)被

gphoto2 ... > /dev/null

此外,--debug抑制建议,所以另一个答案是

gphoto2 ... --debug --debug-logfile=/dev/null

对于日常使用,请在您使用的任何 shell 中将其中一个设为别名。

于 2013-07-02T16:27:55.707 回答