and we make logfile names suck less.
This commit is contained in:
parent
a87f2b4325
commit
ca66b2b7ab
1 changed files with 2 additions and 1 deletions
|
@ -138,7 +138,8 @@ class LogMech(object):
|
||||||
elif self.play_info.get('check', False):
|
elif self.play_info.get('check', False):
|
||||||
category = 'CHECK:' + category
|
category = 'CHECK:' + category
|
||||||
|
|
||||||
fd = open(self.logpath_play + '/' + host + '.log', 'a')
|
sanitize_host = host.replace(' ', '_').replace('>', '-')
|
||||||
|
fd = open(self.logpath_play + '/' + sanitize_host + '.log', 'a')
|
||||||
now = time.strftime(TIME_FORMAT, time.localtime())
|
now = time.strftime(TIME_FORMAT, time.localtime())
|
||||||
fd.write(MSG_FORMAT % dict(now=now, name=name, count=count, category=category, data=json.dumps(data)))
|
fd.write(MSG_FORMAT % dict(now=now, name=name, count=count, category=category, data=json.dumps(data)))
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue