[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] Log & integratiing extra commands
From: |
Akira Li |
Subject: |
Re: [Fab-user] Log & integratiing extra commands |
Date: |
Wed, 24 Feb 2010 12:18:50 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Nicolas Steinmetz <address@hidden> writes:
> > My other concern is that I would like that all actions are written to a
> log
> > file so that I can audit if a deployment went well or not.
>
> Your assumption that output currently only goes to stdout/stderr, is
> correct -- however, there are plans to change this. See
> http://code.fabfile.org/issues/show/57 :)
As a workaround you could replace stdout/stderr:
class Tee:
def __init__(self, *files):
self.files = files
def write(self, *args, **kwargs):
for f in self.files:
f.write(*args, **kwargs)
Example:
sys.stdout = Tee(sys.__stdout__, open('out.log', 'w'))
--
Akira.