[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Duplicity-tracker] [patch #6692] Print collection status in a machine-r
From: |
Michael Terry |
Subject: |
[Duplicity-tracker] [patch #6692] Print collection status in a machine-readable way |
Date: |
Mon, 15 Dec 2008 00:55:26 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/8.10 (intrepid) Firefox/3.0.4 |
URL:
<http://savannah.nongnu.org/patch/?6692>
Summary: Print collection status in a machine-readable way
Project: duplicity
Submitted by: mikix
Submitted on: Sun 14 Dec 2008 07:55:23 PM EST
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Hello! I'm attaching a patch to log the collection-status command in a
machine-readable format.
In the course of doing this, I changed a few things about log.py:
1) I added a flag to force logging of a particular message, regardless of
what the verbosity level is. This is useful for when the user ran 'duplicity
collection-status' and we *know* we want to print it.
2) I set level names for all the verbosity levels. The problem was 'how
would a consumer know how to process a level 8 message?'. Up to now,
duplicity just didn't spit them out. So I changed it so that several levels
together have the same keyword. For example, level 5 is INFO. All levels
above it (up to DEBUG) are also now INFO. This way, all messages get properly
output to the log.
3) I made a minor modification in how the MachineFormatter formats the text
so that only the user-text-hint part gets prefixed with ". ".
The format I chose for the actual logging of collection-status is similar to
the overall logging format. Here's a sample output:
INFO 3
backend LocalBackend
archive-dir None
chain-no-sig 0
full 2008-12-13T10:41:26-05:00 1
inc 2008-12-13T10:42:33-05:00 1
inc 2008-12-13T10:44:04-05:00 1
inc 2008-12-13T10:45:00-05:00 1
inc 2008-12-13T10:52:25-05:00 1
orphaned-sets-num 0
incomplete-sets-num 0
. Collection Status
. -----------------
. Connecting with backend: LocalBackend
. Archive dir: None
.
. Found 1 backup chains without signatures.
. Signature-less chain 1 of 1:
. -------------------------
. Chain start time: Sat Dec 13 10:41:26 2008
. Chain end time: Sat Dec 13 10:52:25 2008
. Number of contained backup sets: 5
. Total number of contained volumes: 5
. Type of backup set: Time: Num volumes:
. Full Sat Dec 13 10:41:26 2008 1
. Incremental Sat Dec 13 10:42:33 2008 1
. Incremental Sat Dec 13 10:44:04 2008 1
. Incremental Sat Dec 13 10:45:00 2008 1
. Incremental Sat Dec 13 10:52:25 2008 1
. -------------------------
.
. No backup chains with active signatures found
. No orphaned or incomplete backup sets found.
You can see the user-text is still there in case a wrapper wants to print
that. But above it, you have several lines with sub-keywords and an indented
list of sets.
It's a bit made-up, but it seemed a reasonable extension.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 14 Dec 2008 07:55:23 PM EST Name: collection-status.diff Size:
7kB By: mikix
<http://savannah.nongnu.org/patch/download.php?file_id=17062>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?6692>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [Duplicity-tracker] [patch #6692] Print collection status in a machine-readable way,
Michael Terry <=