2017-06-01 112 views
0

我已經成功地發現打印整個日誌條目的方法:Python的SVN - 輸出日誌消息

import svn.remote 

control = svn.remote.RemoteClient('http://10.41.10.29/svn/directory/subdirectory') 
for e in control.log_default(): 
     pprint.pprint(e) 

...產生的輸出是這樣的:

LogEntry(date=datetime.datetime(2017, 5, 3, 17, 6, 3, 905705, tzinfo=tzutc()), msg='we did something to this', revision=24945, author='bob', changelist=None) 
LogEntry(date=datetime.datetime(2017, 4, 10, 14, 52, 37, 145437, tzinfo=tzutc()), msg='wow another change we made', revision=24635, author='bobdrick', changelist=None) 

...等上。有沒有什麼方法可以輸出條目的「msg ='...'」部分?

回答

0

我想通了,語法如下:

for e in control.log_default(): 
     pprint.pprint(e.msg) 

簡易修復我忽略