python 织物日志记录
我遇到了织物模块 - 它真的很酷。这对我来说效果很好。现在我有一个问题,如何从结构脚本收集输出?
# cat fabfile.py
from fabric.api import *
from fabric.contrib.console import confirm
env.hosts = ['localhost' , '172.16.10.112','172.16.10.106']
env.user='testuser'
env.password = 'testuser'
@parallel
def uptime():
run('uname -a')
我想将日志记录模块与 Fabric 一起使用,并在代码本身中使用它们。-不想使用像“fab uptime &> log.out ”这样的正常重定向
I came across fabric modules - Its really cool. It works well for me. Now I have an issue ,how to collect output from fabric script?
# cat fabfile.py
from fabric.api import *
from fabric.contrib.console import confirm
env.hosts = ['localhost' , '172.16.10.112','172.16.10.106']
env.user='testuser'
env.password = 'testuser'
@parallel
def uptime():
run('uname -a')
I would like to use logging modules with fabric and use them inside the code itself .- Don't want to use normal redirection like "fab uptime &> log.out "
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来
fabric
本身并不使用logging
。Issue#57 已经就此问题展开,但恐怕直到它修复为止需要坚持重定向或查看 github 中的一些分支并进行更改才能做到这一点:
ampledata/fabricIt looks like
fabric
itself doesn't uselogging
.Issue#57 is already opened regarding that, but I'm afraid that until it's fixed you'll need to stick to redirection or have a look at some of the branches in github with changes to do that:
ampledata/fabric