From: Adriana Draghici Date: Fri, 30 Apr 2010 13:03:57 +0000 (+0000) Subject: autorun: append to log files X-Git-Tag: getopt_long~29 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=b26e1456b9ebab09674001424b25cafad154d427;p=cs-p2p-next.git autorun: append to log files --- diff --git a/autorun/server/BitTorrentClientRun.py b/autorun/server/BitTorrentClientRun.py index aadc798..c336e03 100644 --- a/autorun/server/BitTorrentClientRun.py +++ b/autorun/server/BitTorrentClientRun.py @@ -73,8 +73,8 @@ class BitTorrentClientRun: break; #self.my_logger.debug(" BitTorrentClientRun: command =" + str(args)) - log_redirect = open(self.log_dir+"/"+self.log_file,"w") - output_redirect = open(self.output_dir+"/"+self.output_file,"w") + log_redirect = open(self.log_dir+"/"+self.log_file,"a") + output_redirect = open(self.output_dir+"/"+self.output_file,"a") self.my_logger.debug(" output redirect to file " + self.output_dir+"/"+self.output_file) self.my_logger.debug(" log redirect to file " + self.log_dir+"/"+self.log_file) diff --git a/autorun/server/TransmissionRun.py b/autorun/server/TransmissionRun.py index e58d82b..08f4ca1 100644 --- a/autorun/server/TransmissionRun.py +++ b/autorun/server/TransmissionRun.py @@ -15,8 +15,8 @@ DEBUG = False class TransmissionRun(BitTorrentClientRun): def __init__(self, base_path): BitTorrentClientRun.__init__(self, base_path, - "$base_path/transmissioncli --download-dir $download_dir --port $port $torrent_file > $output_dir/$output_file", - "TR_DEBUG=2 $base_path/transmission --download-dir $download_dir --port $port $torrent_file 2> $log_dir/$log_file > $output_dir/$output_file") + "$base_path/transmissioncli --download-dir $download_dir --port $port $torrent_file >> $output_dir/$output_file", + "TR_DEBUG=2 $base_path/transmission --download-dir $download_dir --port $port $torrent_file 2>> $log_dir/$log_file >> $output_dir/$output_file") def main(): diff --git a/autorun/server/TriblerRun.py b/autorun/server/TriblerRun.py index d80cb61..fc35afa 100644 --- a/autorun/server/TriblerRun.py +++ b/autorun/server/TriblerRun.py @@ -20,8 +20,8 @@ class TriblerRun(BitTorrentClientRun): self.set_PYTHONPATH(base_path) BitTorrentClientRun.__init__(self, base_path, - "python $base_path/Tribler/Tools/cmdlinedl.py -o $download_dir -p $port $torrent_file 2> $log_dir/$log_file > $output_dir/$output_file", - "python $base_path/Tribler/Tools/cmdlinedl.py -o $download_dir -p $port $torrent_file 2> $log_dir/$log_file > $output_dir/$output_file") + "python $base_path/Tribler/Tools/cmdlinedl.py -o $download_dir -p $port $torrent_file 2>> $log_dir/$log_file >> $output_dir/$output_file", + "python $base_path/Tribler/Tools/cmdlinedl.py -o $download_dir -p $port $torrent_file 2>> $log_dir/$log_file >> $output_dir/$output_file") self.my_logger = logging.getLogger('autorun.TriblerRun') self.my_logger.setLevel(logging.DEBUG)