From ef79a33ae64761de55f8d12f50356226d36ebe18 Mon Sep 17 00:00:00 2001 From: bescoto Date: Mon, 3 Mar 2003 01:37:10 +0000 Subject: Fixed --print-statistics and spurious server error message git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@290 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/statistics.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'rdiff-backup/rdiff_backup/statistics.py') diff --git a/rdiff-backup/rdiff_backup/statistics.py b/rdiff-backup/rdiff_backup/statistics.py index 6356101..5ed6cd3 100644 --- a/rdiff-backup/rdiff_backup/statistics.py +++ b/rdiff-backup/rdiff_backup/statistics.py @@ -20,7 +20,7 @@ """Generate and process aggregated backup information""" import re, os, time -import Globals, robust, Time, rorpiter, increment +import Globals, robust, Time, rorpiter, increment, log class StatsException(Exception): pass @@ -342,3 +342,11 @@ def write_active_statfileobj(): _active_statfileobj.finish() _active_statfileobj.write_stats_to_rp(session_stats_rp) _active_statfileobj = None + +def print_active_stats(): + """Print statistics of active statobj to stdout and log""" + global _active_statfileobj + assert _active_statfileobj + statmsg = _active_statfileobj.get_stats_logstring("Session statistics") + log.Log.log_to_file(statmsg) + Globals.client_conn.sys.stdout.write(statmsg) -- cgit v1.2.1