Unconventional method - do it at your own risk :-)
If you want to mess a little with code, then in version 1.9.1, line
784 is a print statement (for function getForward)
Insert this before the print line
tempx = sys.stdout
sys.stdout = open('myfilename', 'w')
and this after that line
sys.stdout = tempx
It will redirect all the stdout to a file - you will not get any
printed messages, and everything will go to a file.
I would even go a step farther and replace the function with this
piece of code.
def getForward(users):
import csv
f = open('myfilename', 'wb')
writer = csv.writer(f)
emailsettings = getEmailSettingsObject()
for user in users:
if user.find('@') > 0:
emailsettings.domain = user[user.find('@')+1:]
user = user[:user.find('@')]
else:
emailsettings.domain = domain
forward = emailsettings.GetForward(username=user)
print "User %s: Forward To:%s Enabled:%s Action:%s" % (user,
forward['forwardTo'], forward['enable'], forward['action'])
writer.writerows(user, forward['forwardTo'], forward['enable'],
forward['action'])
This will give you both - a csv output to a file and messages on
stdout too.
Good Luck.
SS
On Sep 9, 6:41 am, Dan Agosto <
danago...@gmail.com> wrote:
> And running this way will give you a little more information (I use loops to
> run commands through CSV files so I use double > (>>).
>
> >> "c:\gam\provisiondata\logs\CreateStf.log" 2>&1
>
> The 2>&1 writes any errors in the log file as well...then my scripts parse
> through the log file and create an error log for me to fix those individuals
> later.
>
> -Dan
>
> On Fri, Sep 9, 2011 at 6:04 AM, Oliver Hartley <
>
>
>
>
>
>
>
>
oliver.hart...@solucionesorion.com> wrote:
> > At the end of your statement add " > log.txt" withou the ".
>
> > Enviado desde mi Galaxy Tab 10.1