duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] Log patch


From: Michael Terry
Subject: [Duplicity-talk] Log patch
Date: Sun, 9 Nov 2008 15:29:21 -0500

Here's a second shot at adding machine-readable output to duplicity.
This version depends on nothing more than the logging module in
Python.  No glib or dbus.

It adds two new arguments (--log-fd and --log-file).  It writes to the
fd or file well-formed 'stanzas' as normal duplicity messages are
output.

For example, if duplicity was going to put an error about command line
syntax, the log would show:

ERROR 2\n
. Command line error: Expected 2 args, got 0\n
. Enter 'duplicity --help' for help screen.\n
\n

The stanza starts with a keyword, has a message id number, followed by
some suggested user text and ending with a newline.  Currently, the
'named' verbosity levels are all supported (DEBUG, INFO, NOTICE,
WARNING, ERROR).

You can output to multiple files or fd at a time.  As part of this
change, I rewrote the current logging to use the logging module too.
I've attached the diff, the readme, and a small unit test file.

Like the first patch, I also made some additional small changes -- I
made the return value for --help be 0, and I added some message id
numbers: ERROR 2 is command line syntax error, 3 is source mismatch.
WARNING 2 -> 6 are certain 'unmatched files were found' warnings.

Eh?

-mt

Attachment: log.diff
Description: Text Data

Attachment: LOG-README
Description: Binary data

Attachment: logtest.py
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]