<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[15301] CalendarServer/branches/users/cdaboo/newlog</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/15301">15301</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2015-11-09 16:06:26 -0800 (Mon, 09 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update log messages to use new .format() syntax. Switch over to new Twisted logging module.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserveraccesslogpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/accesslog.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserverprovisionrootpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/provision/root.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserverpushamppushpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/amppush.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserverpushapplepushpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/applepush.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserverpushnotifierpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/notifier.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserverpushutilpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertapcaldavpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertaptesttest_caldavpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/test/test_caldav.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolscmdlinepy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/cmdline.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolsdkimtoolpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/dkimtool.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolspurgepy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/purge.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolsshellcmdpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/cmd.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolsshellterminalpy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/terminal.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolsshellvfspy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/vfs.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarservertoolsupgradepy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/upgrade.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogcalendarserverwebcalresourcepy">CalendarServer/branches/users/cdaboo/newlog/calendarserver/webcal/resource.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavaccountingpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/accounting.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavauthkerbpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/authkerb.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavcaldavxmlpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/caldavxml.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavclientgeturlpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/geturl.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavclientpoolpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/pool.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavclientreverseproxypy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/reverseproxy.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdatabasepy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/database.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectoryaugmentpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/augment.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectorycalendarpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/calendar.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectorycommonpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/common.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectoryprincipalpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/principal.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectoryutilpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectorybackedaddressbookpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directorybackedaddressbook.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavextensionspy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/extensions.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavfreebusyurlpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/freebusyurl.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavicalpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/ical.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavlocalizationpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/localization.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcacheclientpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheclient.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcachelockpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachelock.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcachepoolpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachepool.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcachepropspy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheprops.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcacherpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacher.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodmkcalendarpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcalendar.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodmkcolpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcol.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodpostpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/post.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodpropfindpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/propfind.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreportpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_addressbook_querypy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_addressbook_query.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_calendar_querypy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_calendar_query.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_freebusypy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_freebusy.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_sync_collectionpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_sync_collection.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavresourcepy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/resource.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavscheduling_storecaldavresourcepy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/scheduling_store/caldav/resource.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavsharingpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sharing.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavsqlpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavstdconfigpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavstorebridgepy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/storebridge.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavtesttest_configpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/test_config.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavtestutilpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavtimezonespy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezones.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavtimezonestdservicepy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezonestdservice.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavupgradepy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/upgrade.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavutilpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtwistedcaldavvcardpy">CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/vcard.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavbasedatastoresubpostgrespy">CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/subpostgres.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavbasedatastoreutilpy">CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavbasepropertystoretestbasepy">CalendarServer/branches/users/cdaboo/newlog/txdav/base/propertystore/test/base.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastorefilepy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/file.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreindex_filepy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/index_file.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastorequeryfilterpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/query/filter.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingcaldavdeliverypy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/caldav/delivery.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingfreebusypy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/freebusy.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingicaldiffpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/icaldiff.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingimipinboundpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/inbound.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingimipoutboundpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/outbound.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingimplicitpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/implicit.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingischeduledkimpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/ischedule/dkim.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingitippy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/itip.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingprocessingpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/processing.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingutilspy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/utils.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingworkpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/work.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoresqlpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoretesttest_implicitpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_implicit.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoretesttest_sqlpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreutilpy">CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastorefilepy">CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/file.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoreindex_filepy">CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/index_file.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoresqlpy">CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoretesttest_sqlpy">CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/test/test_sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoreutilpy">CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastorefilepy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/file.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastorepoddingmigrationhome_syncpy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/podding/migration/home_sync.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoresqlpy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoretesttest_sqlpy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/test_sql.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoretestutilpy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreupgrademigratepy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/migrate.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreupgradesqlupgradepy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/sql/upgrade.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreworkinbox_cleanuppy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/inbox_cleanup.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreworkload_workpy">CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/load_work.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavdpsserverpy">CalendarServer/branches/users/cdaboo/newlog/txdav/dps/server.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavwhodelegatespy">CalendarServer/branches/users/cdaboo/newlog/txdav/who/delegates.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavwhodirectorypy">CalendarServer/branches/users/cdaboo/newlog/txdav/who/directory.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxdavxmlbasepy">CalendarServer/branches/users/cdaboo/newlog/txdav/xml/base.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxweb2davhttppy">CalendarServer/branches/users/cdaboo/newlog/txweb2/dav/http.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxweb2httppy">CalendarServer/branches/users/cdaboo/newlog/txweb2/http.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboonewlogtxweb2logpy">CalendarServer/branches/users/cdaboo/newlog/txweb2/log.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserveraccesslogpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/accesslog.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/accesslog.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/accesslog.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -359,10 +359,10 @@
</span><span class="cx">
</span><span class="cx"> newpath = "%s.%s" % (self.logpath, self.suffix(self.lastDate))
</span><span class="cx"> if os.path.exists(newpath):
</span><del>- log.info("Cannot rotate log file to %s because it already exists." % (newpath,))
</del><ins>+ log.info("Cannot rotate log file to '{path}' because it already exists.", path=newpath)
</ins><span class="cx"> return
</span><span class="cx"> self.accessLog("Log closed - rotating: [%s]." % (datetime.datetime.now().ctime(),), False)
</span><del>- log.info("Rotating log file to: %s" % (newpath,), system="Logging")
</del><ins>+ log.info("Rotating log file to: '{path}'", path=newpath, system="Logging")
</ins><span class="cx"> self.f.close()
</span><span class="cx"> os.rename(self.logpath, newpath)
</span><span class="cx"> self._open()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserverprovisionrootpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/provision/root.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/provision/root.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/provision/root.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -249,9 +249,9 @@
</span><span class="cx"> )
</span><span class="cx"> else:
</span><span class="cx"> log.error(
</span><del>- "Failed to look up wiki token {token}: "
- "{message}",
- token=token, message=w.message
</del><ins>+ "Failed to look up wiki token {token}: {msg}",
+ token=token,
+ msg=w.message
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> except Exception as e:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserverpushamppushpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/amppush.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/amppush.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/amppush.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx">
</span><span class="cx"> def notify(self, token, id, dataChangedTimestamp, priority):
</span><span class="cx"> if self.subscribedToID(id) == token:
</span><del>- self.log.debug("Sending notification for %s to %s" % (id, token))
</del><ins>+ self.log.debug("Sending notification for {id} to {token}", id=id, token=token)
</ins><span class="cx"> return self.callRemote(
</span><span class="cx"> NotificationForID, id=id,
</span><span class="cx"> dataChangedTimestamp=dataChangedTimestamp,
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserverpushapplepushpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/applepush.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/applepush.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/applepush.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -133,8 +133,9 @@
</span><span class="cx"> provider.setServiceParent(service)
</span><span class="cx"> service.providers[protocol] = provider
</span><span class="cx"> service.log.info(
</span><del>- "APNS %s topic: %s" %
- (protocol, settings[protocol]["Topic"]))
</del><ins>+ "APNS {proto} topic: {topic}",
+ proto=protocol, topic=settings[protocol]["Topic"]
+ )
</ins><span class="cx">
</span><span class="cx"> feedback = APNFeedbackService(
</span><span class="cx"> service.store,
</span><span class="lines">@@ -218,7 +219,7 @@
</span><span class="cx"> protocol = pushKey.split("/")[1]
</span><span class="cx"> except ValueError:
</span><span class="cx"> # pushKey has no protocol, so we can't do anything with it
</span><del>- self.log.error("Push key '%s' is missing protocol" % (pushKey,))
</del><ins>+ self.log.error("Push key '{key}' is missing protocol", key=pushKey)
</ins><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> # Unit tests can pass this value in; otherwise it defaults to now
</span><span class="lines">@@ -234,8 +235,9 @@
</span><span class="cx"> numSubscriptions = len(subscriptions)
</span><span class="cx"> if numSubscriptions > 0:
</span><span class="cx"> self.log.debug(
</span><del>- "Sending %d APNS notifications for %s" %
- (numSubscriptions, pushKey))
</del><ins>+ "Sending {num} APNS notifications for {key}",
+ num=numSubscriptions, key=pushKey
+ )
</ins><span class="cx"> tokens = [record.token for record in subscriptions if record.token and record.subscriberGUID]
</span><span class="cx"> if tokens:
</span><span class="cx"> provider.scheduleNotifications(
</span><span class="lines">@@ -292,7 +294,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def connectionLost(self, reason=None):
</span><del>- # self.log.debug("ProviderProtocol connectionLost: %s" % (reason,))
</del><ins>+ # self.log.debug("ProviderProtocol connectionLost: {reason}", reason=reason)
</ins><span class="cx"> # Clear the reference to us from the factory
</span><span class="cx"> self.factory.connection = None
</span><span class="cx">
</span><span class="lines">@@ -307,7 +309,7 @@
</span><span class="cx"> if fn is None:
</span><span class="cx"> fn = self.processError
</span><span class="cx">
</span><del>- self.log.debug("ProviderProtocol dataReceived %d bytes" % (len(data),))
</del><ins>+ self.log.debug("ProviderProtocol dataReceived {len} bytes", len=len(data))
</ins><span class="cx"> self.buffer += data
</span><span class="cx">
</span><span class="cx"> while len(self.buffer) >= self.MESSAGE_LENGTH:
</span><span class="lines">@@ -320,8 +322,9 @@
</span><span class="cx"> yield fn(status, identifier)
</span><span class="cx"> except Exception, e:
</span><span class="cx"> self.log.warn(
</span><del>- "ProviderProtocol could not process error: %s (%s)" %
- (message.encode("hex"), e))
</del><ins>+ "ProviderProtocol could not process error: {code} ({ex})",
+ code=message.encode("hex"), ex=e
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -339,19 +342,21 @@
</span><span class="cx"> @type status: C{int}
</span><span class="cx"> """
</span><span class="cx"> msg = self.STATUS_CODES.get(status, "Unknown status code")
</span><del>- self.log.info("Received APN error %d on identifier %d: %s" % (status, identifier, msg))
</del><ins>+ self.log.info("Received APN error {status} on identifier {id}: {msg}", status=status, id=identifier, msg=msg)
</ins><span class="cx"> if status in self.TOKEN_REMOVAL_CODES:
</span><span class="cx"> token = self.history.extractIdentifier(identifier)
</span><span class="cx"> if token is not None:
</span><span class="cx"> self.log.debug(
</span><del>- "Removing subscriptions for bad token: %s" %
- (token,))
</del><ins>+ "Removing subscriptions for bad token: {token}",
+ token=token,
+ )
</ins><span class="cx"> txn = self.factory.store.newTransaction(label="APNProviderProtocol.processError")
</span><span class="cx"> subscriptions = (yield txn.apnSubscriptionsByToken(token))
</span><span class="cx"> for record in subscriptions:
</span><span class="cx"> self.log.debug(
</span><del>- "Removing subscription: %s %s" %
- (token, record.resourceKey))
</del><ins>+ "Removing subscription: {token} {key}",
+ token=token, key=record.resourceKey
+ )
</ins><span class="cx"> yield txn.removeAPNSubscription(token, record.resourceKey)
</span><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="lines">@@ -376,7 +381,7 @@
</span><span class="cx"> try:
</span><span class="cx"> binaryToken = token.replace(" ", "").decode("hex")
</span><span class="cx"> except:
</span><del>- self.log.error("Invalid APN token in database: %s" % (token,))
</del><ins>+ self.log.error("Invalid APN token in database: {token}", token=token)
</ins><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> identifier = self.history.add(token)
</span><span class="lines">@@ -485,12 +490,12 @@
</span><span class="cx">
</span><span class="cx"> def clientConnectionLost(self, connector, reason):
</span><span class="cx"> if not self.shuttingDown:
</span><del>- self.log.info("Connection to APN server lost: %s" % (reason,))
</del><ins>+ self.log.info("Connection to APN server lost: {reason}", reason=reason)
</ins><span class="cx"> ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def clientConnectionFailed(self, connector, reason):
</span><del>- self.log.error("Unable to connect to APN server: %s" % (reason,))
</del><ins>+ self.log.error("Unable to connect to APN server: {reason}", reason=reason)
</ins><span class="cx"> self.connected = False
</span><span class="cx"> ReconnectingClientFactory.clientConnectionFailed(
</span><span class="cx"> self, connector,
</span><span class="lines">@@ -653,10 +658,10 @@
</span><span class="cx"> tokenKeyPair = (token, key)
</span><span class="cx"> for existingPair, _ignore_timstamp, priority in self.queue:
</span><span class="cx"> if tokenKeyPair == existingPair:
</span><del>- self.log.debug("APNProviderService has no connection; skipping duplicate: %s %s" % (token, key))
</del><ins>+ self.log.debug("APNProviderService has no connection; skipping duplicate: {token} {key}", token=token, key=key)
</ins><span class="cx"> break # Already scheduled
</span><span class="cx"> else:
</span><del>- self.log.debug("APNProviderService has no connection; queuing: %s %s" % (token, key))
</del><ins>+ self.log.debug("APNProviderService has no connection; queuing: {token} {key}", token=token, key=key)
</ins><span class="cx"> self.queue.append(((token, key), dataChangedTimestamp, priority))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -708,7 +713,7 @@
</span><span class="cx"> if fn is None:
</span><span class="cx"> fn = self.processFeedback
</span><span class="cx">
</span><del>- self.log.debug("FeedbackProtocol dataReceived %d bytes" % (len(data),))
</del><ins>+ self.log.debug("FeedbackProtocol dataReceived {len} bytes", len=len(data))
</ins><span class="cx"> self.buffer += data
</span><span class="cx">
</span><span class="cx"> while len(self.buffer) >= self.MESSAGE_LENGTH:
</span><span class="lines">@@ -723,8 +728,9 @@
</span><span class="cx"> yield fn(timestamp, token)
</span><span class="cx"> except Exception, e:
</span><span class="cx"> self.log.warn(
</span><del>- "FeedbackProtocol could not process message: %s (%s)" %
- (message.encode("hex"), e))
</del><ins>+ "FeedbackProtocol could not process message: {code} ({ex})",
+ code=message.encode("hex"), ex=e
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -743,16 +749,18 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> self.log.debug(
</span><del>- "FeedbackProtocol processFeedback time=%d token=%s" %
- (timestamp, token))
</del><ins>+ "FeedbackProtocol processFeedback time={time} token={token}",
+ time=timestamp, token=token
+ )
</ins><span class="cx"> txn = self.factory.store.newTransaction(label="APNFeedbackProtocol.processFeedback")
</span><span class="cx"> subscriptions = (yield txn.apnSubscriptionsByToken(token))
</span><span class="cx">
</span><span class="cx"> for record in subscriptions:
</span><span class="cx"> if timestamp > record.modified:
</span><span class="cx"> self.log.debug(
</span><del>- "FeedbackProtocol removing subscription: %s %s" %
- (token, record.resourceKey))
</del><ins>+ "FeedbackProtocol removing subscription: {token} {key}",
+ token=token, key=record.resourceKey,
+ )
</ins><span class="cx"> yield txn.removeAPNSubscription(token, record.resourceKey)
</span><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="lines">@@ -769,8 +777,9 @@
</span><span class="cx">
</span><span class="cx"> def clientConnectionFailed(self, connector, reason):
</span><span class="cx"> self.log.error(
</span><del>- "Unable to connect to APN feedback server: %s" %
- (reason,))
</del><ins>+ "Unable to connect to APN feedback server: {reason}",
+ reason=reason,
+ )
</ins><span class="cx"> self.connected = False
</span><span class="cx"> ClientFactory.clientConnectionFailed(self, connector, reason)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserverpushnotifierpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/notifier.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/notifier.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/notifier.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -107,12 +107,12 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def enableNotify(self, arg):
</span><del>- self.log.debug("enableNotify: %s" % (self._ids['default'][1],))
</del><ins>+ self.log.debug("enableNotify: {id}", id=self._ids['default'][1])
</ins><span class="cx"> self._notify = True
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def disableNotify(self):
</span><del>- self.log.debug("disableNotify: %s" % (self._ids['default'][1],))
</del><ins>+ self.log.debug("disableNotify: {id}", id=self._ids['default'][1])
</ins><span class="cx"> self._notify = False
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -138,15 +138,17 @@
</span><span class="cx"> for prefix, id in ids:
</span><span class="cx"> if self._notify:
</span><span class="cx"> self.log.debug(
</span><del>- "Notifications are enabled: %s %s/%s priority=%d" %
- (self._storeObject, prefix, id, priority.value))
</del><ins>+ "Notifications are enabled: {obj} {prefix}/{id} priority={priority}",
+ obj=self._storeObject, prefix=prefix, id=id, priority=priority.value
+ )
</ins><span class="cx"> yield self._notifierFactory.send(
</span><span class="cx"> prefix, id, txn,
</span><span class="cx"> priority=priority)
</span><span class="cx"> else:
</span><span class="cx"> self.log.debug(
</span><del>- "Skipping notification for: %s %s/%s" %
- (self._storeObject, prefix, id,))
</del><ins>+ "Skipping notification for: %{obj} {prefix}/{id}",
+ obj=self._storeObject, prefix=prefix, id=id,
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def clone(self, storeObject):
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserverpushutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/push/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -189,15 +189,17 @@
</span><span class="cx"> internalKey = (token, key)
</span><span class="cx"> if internalKey in self.outstanding:
</span><span class="cx"> self.log.debug(
</span><del>- "PushScheduler already has this scheduled: %s" %
- (internalKey,))
</del><ins>+ "PushScheduler already has this scheduled: {key}",
+ key=internalKey,
+ )
</ins><span class="cx"> else:
</span><span class="cx"> self.outstanding[internalKey] = self.reactor.callLater(
</span><span class="cx"> scheduleTime, self.send, token, key, dataChangedTimestamp,
</span><span class="cx"> priority)
</span><span class="cx"> self.log.debug(
</span><del>- "PushScheduler scheduled: %s in %.0f sec" %
- (internalKey, scheduleTime))
</del><ins>+ "PushScheduler scheduled: {key} in {time:.0f} sec",
+ key=internalKey, time=scheduleTime
+ )
</ins><span class="cx"> scheduleTime += self.staggerSeconds
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -215,7 +217,7 @@
</span><span class="cx"> which triggered this notification
</span><span class="cx"> @type key: C{int}
</span><span class="cx"> """
</span><del>- self.log.debug("PushScheduler fired for %s %s %d" % (token, key, dataChangedTimestamp))
</del><ins>+ self.log.debug("PushScheduler fired for {token} {key} {time}", token=token, key=key, time=dataChangedTimestamp)
</ins><span class="cx"> del self.outstanding[(token, key)]
</span><span class="cx"> return self.callback(token, key, dataChangedTimestamp, priority)
</span><span class="cx">
</span><span class="lines">@@ -225,5 +227,5 @@
</span><span class="cx"> Cancel all outstanding delayed calls
</span><span class="cx"> """
</span><span class="cx"> for (token, key), delayed in self.outstanding.iteritems():
</span><del>- self.log.debug("PushScheduler cancelling %s %s" % (token, key))
</del><ins>+ self.log.debug("PushScheduler cancelling {token} {key}", token=token, key=key)
</ins><span class="cx"> delayed.cancel()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/caldav.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/caldav.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/caldav.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">
</span><span class="cx"> from twistedcaldav.stdconfig import config
</span><span class="cx">
</span><del>-from twisted.python.log import FileLogObserver, ILogObserver
</del><ins>+from twisted.python.log import ILogObserver
</ins><span class="cx"> from twisted.python.logfile import LogFile
</span><span class="cx"> from twisted.python.usage import Options, UsageError
</span><span class="cx"> from twisted.python.util import uidFromString, gidFromString
</span><span class="lines">@@ -56,9 +56,10 @@
</span><span class="cx"> from twisted.application.service import MultiService, IServiceMaker
</span><span class="cx"> from twisted.application.service import Service
</span><span class="cx"> from twisted.protocols.amp import AMP
</span><ins>+from twisted.logger import LogLevel
</ins><span class="cx">
</span><span class="cx"> from twext.python.filepath import CachingFilePath
</span><del>-from twext.python.log import Logger, LogLevel, replaceTwistedLoggers
</del><ins>+from twext.python.log import Logger
</ins><span class="cx"> from twext.internet.fswatch import (
</span><span class="cx"> DirectoryChangeListener, IDirectoryChangeListenee
</span><span class="cx"> )
</span><span class="lines">@@ -254,13 +255,16 @@
</span><span class="cx"> rotateLength=self.logRotateLength,
</span><span class="cx"> maxRotatedFiles=self.logMaxFiles
</span><span class="cx"> )
</span><del>- errorLogObserver = FileLogObserver(errorLogFile).emit
</del><span class="cx"> if self.logRotateOnStart:
</span><span class="cx"> errorLogFile.rotate()
</span><ins>+ else:
+ errorLogFile = sys.stdout
+ withTime = not (not config.ErrorLogFile and config.ProcessType in ("Slave", "DPS",))
+ errorLogObserver = Logger.makeFilteredFileLogObserver(errorLogFile, withTime=withTime)
</ins><span class="cx">
</span><del>- # Registering ILogObserver with the Application object
- # gets our observer picked up within AppLogger.start( )
- app.setComponent(ILogObserver, errorLogObserver)
</del><ins>+ # Registering ILogObserver with the Application object
+ # gets our observer picked up within AppLogger.start( )
+ app.setComponent(ILogObserver, errorLogObserver)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -452,13 +456,6 @@
</span><span class="cx">
</span><span class="cx"> self.checkDirectories(config)
</span><span class="cx">
</span><del>- #
- # Nuke the file log observer's time format.
- #
-
- if not config.ErrorLogFile and config.ProcessType == "Slave":
- FileLogObserver.timeFormat = ""
-
</del><span class="cx"> # Check current umask and warn if changed
</span><span class="cx"> oldmask = umask(config.umask)
</span><span class="cx"> if oldmask != config.umask:
</span><span class="lines">@@ -534,6 +531,9 @@
</span><span class="cx"> "--reactor={}".format(config.Twisted.reactor),
</span><span class="cx"> "-n", "caldav_directoryproxy",
</span><span class="cx"> "-f", self.configPath,
</span><ins>+ "-o", "ProcessType=DPS",
+ "-o", "ErrorLogFile=None",
+ "-o", "ErrorLogEnabled=False",
</ins><span class="cx"> ))
</span><span class="cx"> self.monitor.addProcess(
</span><span class="cx"> "directoryproxy", dpsArgv, env=PARENT_ENVIRONMENT
</span><span class="lines">@@ -746,7 +746,6 @@
</span><span class="cx"> """
</span><span class="cx"> Create the top-level service.
</span><span class="cx"> """
</span><del>- replaceTwistedLoggers()
</del><span class="cx">
</span><span class="cx"> self.log.info(
</span><span class="cx"> "{log_source.description} {version} starting "
</span><span class="lines">@@ -988,8 +987,8 @@
</span><span class="cx"> # Change default log level to "info" as its useful to have
</span><span class="cx"> # that during startup
</span><span class="cx"> #
</span><del>- oldLogLevel = log.publisher.levels.logLevelForNamespace(None)
- log.publisher.levels.setLogLevelForNamespace(None, LogLevel.info)
</del><ins>+ oldLogLevel = log.levels().logLevelForNamespace(None)
+ log.levels().setLogLevelForNamespace(None, LogLevel.info)
</ins><span class="cx">
</span><span class="cx"> # Note: 'additional' was used for IMIP reply resource, and perhaps
</span><span class="cx"> # we can remove this
</span><span class="lines">@@ -1175,7 +1174,7 @@
</span><span class="cx"> ).setServiceParent(connectionService)
</span><span class="cx">
</span><span class="cx"> # Change log level back to what it was before
</span><del>- log.publisher.levels.setLogLevelForNamespace(None, oldLogLevel)
</del><ins>+ log.levels().setLogLevelForNamespace(None, oldLogLevel)
</ins><span class="cx"> return service
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -2559,8 +2558,9 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def lineReceived(self, line):
</span><del>- from twisted.python.log import msg
- msg("[{}] {}".format(self.tag, line))
</del><ins>+ # Hand off slave log entry to logging system as critical to ensure it is always
+ # displayed (as the slave will have filtered out unwanted entries itself).
+ log.critical("{msg}", msg=line, log_system=self.tag, isError=False)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def lineLengthExceeded(self, line):
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertaptesttest_caldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/test/test_caldav.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/test/test_caldav.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tap/test/test_caldav.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx"> finally:
</span><span class="cx"> sys.stdout = oldout
</span><span class="cx"> log.info(
</span><del>- "load configuration console output: %s" % newout.getvalue()
</del><ins>+ "load configuration console output: {result}", result=newout.getvalue()
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1087,10 +1087,9 @@
</span><span class="cx"> return
</span><span class="cx"> if event.get('isError'):
</span><span class="cx"> d.errback()
</span><del>- m = event.get('message')[0]
- if m.startswith('[Dummy] '):
- logged.append(event)
- if m == '[Dummy] z':
</del><ins>+ if event.get("log_system") == u'Dummy':
+ logged.append(event["msg"])
+ if event["msg"] == u'z':
</ins><span class="cx"> d.callback("done")
</span><span class="cx">
</span><span class="cx"> logging.addObserver(tempObserver)
</span><span class="lines">@@ -1098,18 +1097,16 @@
</span><span class="cx"> d = Deferred()
</span><span class="cx">
</span><span class="cx"> def assertions(result):
</span><del>- self.assertEquals(["[Dummy] x",
- "[Dummy] y",
- "[Dummy] y", # final segment
- "[Dummy] z"],
- [''.join(evt['message'])[:len('[Dummy]') + 2]
- for evt in logged])
</del><ins>+ self.assertEquals(["x",
+ "y",
+ "y", # final segment
+ "z"],
+ [msg[0] for msg in logged])
</ins><span class="cx"> self.assertEquals([" (truncated, continued)",
</span><span class="cx"> " (truncated, continued)",
</span><del>- "[Dummy] y",
- "[Dummy] z"],
- [''.join(evt['message'])[-len(" (truncated, continued)"):]
- for evt in logged])
</del><ins>+ "y",
+ "z"],
+ [msg[-len(" (truncated, continued)"):] for msg in logged])
</ins><span class="cx"> d.addCallback(assertions)
</span><span class="cx"> return d
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolscmdlinepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/cmdline.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/cmdline.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/cmdline.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -18,22 +18,23 @@
</span><span class="cx"> Shared main-point between utilities.
</span><span class="cx"> """
</span><span class="cx">
</span><del>-from calendarserver.tap.util import checkDirectories
</del><ins>+from calendarserver.tap.util import checkDirectories, getRootResource
</ins><span class="cx"> from calendarserver.tools.util import loadConfig, autoDisableMemcached
</span><span class="cx">
</span><del>-from twext.python.log import StandardIOObserver
</del><ins>+from twext.enterprise.jobs.queue import NonPerformingQueuer
+from twext.python.log import Logger
</ins><span class="cx">
</span><span class="cx"> from twistedcaldav.config import ConfigurationError
</span><ins>+from twistedcaldav.timezones import TimezoneCache
+
+from twisted.application.service import Service
</ins><span class="cx"> from twisted.internet.defer import inlineCallbacks, succeed
</span><del>-from twisted.application.service import Service
</del><ins>+from twisted.logger import STDLibLogObserver
</ins><span class="cx"> from twisted.python.logfile import LogFile
</span><del>-from twisted.python.log import FileLogObserver
</del><ins>+from twisted.python.log import addObserver
</ins><span class="cx">
</span><span class="cx"> import sys
</span><del>-from calendarserver.tap.util import getRootResource
</del><span class="cx"> from errno import ENOENT, EACCES
</span><del>-from twext.enterprise.jobs.queue import NonPerformingQueuer
-from twistedcaldav.timezones import TimezoneCache
</del><span class="cx">
</span><span class="cx"> # TODO: direct unit tests for these functions.
</span><span class="cx">
</span><span class="lines">@@ -87,7 +88,7 @@
</span><span class="cx">
</span><span class="cx"> # Install std i/o observer
</span><span class="cx"> if verbose:
</span><del>- observer = StandardIOObserver()
</del><ins>+ observer = STDLibLogObserver()
</ins><span class="cx"> observer.start()
</span><span class="cx">
</span><span class="cx"> if reactor is None:
</span><span class="lines">@@ -104,8 +105,8 @@
</span><span class="cx"> rotateLength=config.ErrorLogRotateMB * 1024 * 1024,
</span><span class="cx"> maxRotatedFiles=config.ErrorLogMaxRotatedFiles
</span><span class="cx"> )
</span><del>- utilityLogObserver = FileLogObserver(utilityLogFile)
- utilityLogObserver.start()
</del><ins>+ utilityLogObserver = Logger.makeFilteredFileLogObserver(utilityLogFile)
+ addObserver(utilityLogObserver)
</ins><span class="cx">
</span><span class="cx"> config.ProcessType = "Utility"
</span><span class="cx"> config.UtilityServiceClass = _makeValidService
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolsdkimtoolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/dkimtool.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/dkimtool.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/dkimtool.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -22,9 +22,10 @@
</span><span class="cx">
</span><span class="cx"> from twisted.internet import reactor
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks
</span><ins>+from twisted.logger import LogLevel, STDLibLogObserver
</ins><span class="cx"> from twisted.python.usage import Options
</span><span class="cx">
</span><del>-from twext.python.log import Logger, LogLevel, StandardIOObserver
</del><ins>+from twext.python.log import Logger
</ins><span class="cx"> from txweb2.http_headers import Headers
</span><span class="cx">
</span><span class="cx"> from txdav.caldav.datastore.scheduling.ischedule.dkim import RSA256, DKIMRequest, \
</span><span class="lines">@@ -69,7 +70,7 @@
</span><span class="cx"> def _doRequest(options):
</span><span class="cx">
</span><span class="cx"> if options["verbose"]:
</span><del>- log.publisher.levels.setLogLevelForNamespace("txdav.caldav.datastore.scheduling.ischedule.dkim", LogLevel.debug)
</del><ins>+ log.levels().setLogLevelForNamespace("txdav.caldav.datastore.scheduling.ischedule.dkim", LogLevel.debug)
</ins><span class="cx">
</span><span class="cx"> # Parse the HTTP file
</span><span class="cx"> with open(options["request"]) as f:
</span><span class="lines">@@ -300,11 +301,11 @@
</span><span class="cx"> #
</span><span class="cx"> # Send logging output to stdout
</span><span class="cx"> #
</span><del>- observer = StandardIOObserver()
</del><ins>+ observer = STDLibLogObserver()
</ins><span class="cx"> observer.start()
</span><span class="cx">
</span><span class="cx"> if options["verbose"]:
</span><del>- log.publisher.levels.setLogLevelForNamespace("txdav.caldav.datastore.scheduling.ischedule.dkim", LogLevel.debug)
</del><ins>+ log.levels().setLogLevelForNamespace("txdav.caldav.datastore.scheduling.ischedule.dkim", LogLevel.debug)
</ins><span class="cx">
</span><span class="cx"> if options["key-gen"]:
</span><span class="cx"> _doKeyGeneration(options)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolspurgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/purge.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/purge.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/purge.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx"> """
</span><span class="cx"> Find all the calendar homes that match the uuid cli argument.
</span><span class="cx"> """
</span><del>- log.debug("Searching for calendar homes matching: '{}'".format(self.uuid))
</del><ins>+ log.debug("Searching for calendar homes matching: '{uid}'", uid=self.uuid)
</ins><span class="cx"> txn = self.store.newTransaction(label="Find matching homes")
</span><span class="cx"> ch = schema.CALENDAR_HOME
</span><span class="cx"> if self.uuid:
</span><span class="lines">@@ -437,7 +437,7 @@
</span><span class="cx"> ).on(txn))
</span><span class="cx">
</span><span class="cx"> yield txn.commit()
</span><del>- log.debug(" Found {} calendar homes".format(len(rows)))
</del><ins>+ log.debug(" Found {len} calendar homes", len=len(rows))
</ins><span class="cx"> returnValue(sorted(rows, key=lambda x: x[1]))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx"> @param owner_uid: owner UUID of home to check
</span><span class="cx"> @type owner_uid: L{str}
</span><span class="cx"> """
</span><del>- log.debug("Checking calendar home: {} '{}'".format(home_id, owner_uid))
</del><ins>+ log.debug("Checking calendar home: {id} '{uid}'", id=home_id, uid=owner_uid)
</ins><span class="cx"> txn = self.store.newTransaction(label="Find matching calendars")
</span><span class="cx"> cb = schema.CALENDAR_BIND
</span><span class="cx"> kwds = {"home_id": home_id}
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx"> ),
</span><span class="cx"> ).on(txn, **kwds))
</span><span class="cx"> yield txn.commit()
</span><del>- log.debug(" Found {} calendars".format(len(rows)))
</del><ins>+ log.debug(" Found {len} calendars", len=len(rows))
</ins><span class="cx"> returnValue(rows)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -483,7 +483,7 @@
</span><span class="cx"> @type calendar_name: L{str}
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug(" Checking calendar: {} '{}'".format(calendar_id, calendar_name))
</del><ins>+ log.debug(" Checking calendar: {id} '{name}'", id=calendar_id, name=calendar_name)
</ins><span class="cx"> purge = set()
</span><span class="cx"> txn = self.store.newTransaction(label="Find matching resources")
</span><span class="cx"> co = schema.CALENDAR_OBJECT
</span><span class="lines">@@ -503,7 +503,7 @@
</span><span class="cx"> ),
</span><span class="cx"> ).on(txn, **kwds))
</span><span class="cx">
</span><del>- log.debug(" Found {} resources to check".format(len(rows)))
</del><ins>+ log.debug(" Found {len} resources to check", len=len(rows))
</ins><span class="cx"> for resource_id, recurrence_max, recurrence_min, max_end_date in rows:
</span><span class="cx">
</span><span class="cx"> recurrence_max = parseSQLDateToPyCalendar(recurrence_max) if recurrence_max else None
</span><span class="lines">@@ -530,7 +530,7 @@
</span><span class="cx"> purge.add(self.PurgeEvent(home_id, calendar_id, resource_id,))
</span><span class="cx">
</span><span class="cx"> yield txn.commit()
</span><del>- log.debug(" Found {} resources to purge".format(len(purge)))
</del><ins>+ log.debug(" Found {len} resources to purge", len=len(purge))
</ins><span class="cx"> returnValue(purge)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -639,13 +639,14 @@
</span><span class="cx"> last_calendar = event.calendar
</span><span class="cx"> resource = (yield calendar.objectResourceWithID(event.resource))
</span><span class="cx"> yield resource.purge(implicitly=False)
</span><del>- log.debug("Removed resource {} '{}' from calendar {} '{}' of calendar home '{}'".format(
- resource.id(),
- resource.name(),
- resource.parentCollection().id(),
- resource.parentCollection().name(),
- resource.parentCollection().ownerHome().uid()
- ))
</del><ins>+ log.debug(
+ "Removed resource {id} '{name}' from calendar {pid} '{pname}' of calendar home '{uid}'",
+ id=resource.id(),
+ name=resource.name(),
+ pid=resource.parentCollection().id(),
+ pname=resource.parentCollection().name(),
+ uid=resource.parentCollection().ownerHome().uid()
+ )
</ins><span class="cx"> count += 1
</span><span class="cx"> yield txn.commit()
</span><span class="cx"> returnValue(count)
</span><span class="lines">@@ -679,18 +680,18 @@
</span><span class="cx"> if self.dryrun:
</span><span class="cx"> eventCount = len(purge)
</span><span class="cx"> if eventCount == 0:
</span><del>- log.info("No events are older than %s" % (self.cutoff,))
</del><ins>+ log.info("No events are older than {cutoff}", cutoff=self.cutoff)
</ins><span class="cx"> elif eventCount == 1:
</span><del>- log.info("1 event is older than %s" % (self.cutoff,))
</del><ins>+ log.info("1 event is older than {cutoff}", cutoff=self.cutoff)
</ins><span class="cx"> else:
</span><del>- log.info("%d events are older than %s" % (eventCount, self.cutoff))
</del><ins>+ log.info("{count} events are older than {cutoff}", count=eventCount, cutoff=self.cutoff)
</ins><span class="cx"> returnValue(eventCount)
</span><span class="cx">
</span><span class="cx"> purge = list(purge)
</span><span class="cx"> purge.sort()
</span><span class="cx"> totalEvents = len(purge)
</span><span class="cx">
</span><del>- log.info("Removing {} events older than {}...".format(len(purge), self.cutoff,))
</del><ins>+ log.info("Removing {len} events older than {cutoff}...", len=len(purge), cutoff=self.cutoff)
</ins><span class="cx">
</span><span class="cx"> numEventsRemoved = -1
</span><span class="cx"> totalRemoved = 0
</span><span class="lines">@@ -698,7 +699,7 @@
</span><span class="cx"> numEventsRemoved = (yield self.purgeResources(purge[:self.batchSize]))
</span><span class="cx"> if numEventsRemoved:
</span><span class="cx"> totalRemoved += numEventsRemoved
</span><del>- log.debug(" Removed {} of {} events...".format(totalRemoved, totalEvents))
</del><ins>+ log.debug(" Removed {removed} of {total} events...", removed=totalRemoved, total=totalEvents)
</ins><span class="cx"> purge = purge[numEventsRemoved:]
</span><span class="cx">
</span><span class="cx"> if totalRemoved == 0:
</span><span class="lines">@@ -706,7 +707,7 @@
</span><span class="cx"> elif totalRemoved == 1:
</span><span class="cx"> log.info("1 event was removed in total")
</span><span class="cx"> else:
</span><del>- log.info("%d events were removed in total" % (totalRemoved,))
</del><ins>+ log.info("{total} events were removed in total", total=totalRemoved)
</ins><span class="cx">
</span><span class="cx"> returnValue(totalRemoved)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolsshellcmdpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/cmd.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/cmd.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/cmd.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -472,7 +472,7 @@
</span><span class="cx"> if not isinstance(wd, Folder):
</span><span class="cx"> raise NotFoundError("Not a folder: %s" % (wd,))
</span><span class="cx">
</span><del>- # log.info("wd -> %s" % (wd,))
</del><ins>+ # log.info("wd -> {wd}", wd=wd)
</ins><span class="cx"> self.wd = wd
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolsshellterminalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/terminal.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/terminal.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/terminal.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> except Exception, e:
</span><span class="cx"> self.handleFailure(Failure(e))
</span><span class="cx"> return
</span><del>- log.info("COMPLETIONS: %r" % (completions,))
</del><ins>+ log.info("COMPLETIONS: {comp}", comp=completions)
</ins><span class="cx"> else:
</span><span class="cx"> # Completing command name
</span><span class="cx"> completions = tuple(self.commands.complete_commands(cmd))
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolsshellvfspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/vfs.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/vfs.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/shell/vfs.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -691,7 +691,7 @@
</span><span class="cx"> self.mainComponent = mainComponent
</span><span class="cx">
</span><span class="cx"> except InvalidICalendarDataError, e:
</span><del>- log.error("%s: %s" % (self.path, e))
</del><ins>+ log.error("{path}: {ex}", path=self.path, ex=e)
</ins><span class="cx">
</span><span class="cx"> self.componentType = "?"
</span><span class="cx"> self.summary = "** Invalid data **"
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarservertoolsupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/upgrade.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/upgrade.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/tools/upgrade.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -26,10 +26,11 @@
</span><span class="cx"> import time
</span><span class="cx">
</span><span class="cx"> from twisted.internet.defer import succeed
</span><ins>+from twisted.logger import LogLevel, formatEvent
</ins><span class="cx"> from twisted.python.text import wordWrap
</span><span class="cx"> from twisted.python.usage import Options, UsageError
</span><span class="cx">
</span><del>-from twext.python.log import Logger, LogLevel, formatEvent, addObserver
</del><ins>+from twext.python.log import Logger
</ins><span class="cx">
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG_FILE
</span><span class="cx">
</span><span class="lines">@@ -220,8 +221,8 @@
</span><span class="cx"> output.flush()
</span><span class="cx">
</span><span class="cx"> if not options["status"]:
</span><del>- log.publisher.levels.setLogLevelForNamespace(None, LogLevel.debug)
- addObserver(onlyUpgradeEvents)
</del><ins>+ log.levels().setLogLevelForNamespace(None, LogLevel.debug)
+ log.observer.addObserver(onlyUpgradeEvents)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def customServiceMaker():
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogcalendarserverwebcalresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/calendarserver/webcal/resource.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/calendarserver/webcal/resource.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/calendarserver/webcal/resource.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> tzid = queryValue("tzid")
</span><span class="cx"> if not tzid:
</span><span class="cx"> tzid = getLocalTimezone()
</span><del>- self.log.debug("Determined timezone to be %s" % (tzid,))
</del><ins>+ self.log.debug("Determined timezone to be {tzid}", tzid=tzid)
</ins><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Make some HTML
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavaccountingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/accounting.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/accounting.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/accounting.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> logFilename = path
</span><span class="cx"> break
</span><span class="cx"> if index == 1000:
</span><del>- log.error("Too many %s accounting files for %s" % (category, record))
</del><ins>+ log.error("Too many {cat} accounting files for {rec}", cat=category, rec=record)
</ins><span class="cx"> return None
</span><span class="cx"> index += 1
</span><span class="cx">
</span><span class="lines">@@ -141,5 +141,5 @@
</span><span class="cx">
</span><span class="cx"> except OSError, e:
</span><span class="cx"> # No failures in accounting should propagate out
</span><del>- log.error("Failed to write accounting data due to: %s" % (str(e),))
</del><ins>+ log.error("Failed to write accounting data due to: {ex}", ex=str(e))
</ins><span class="cx"> return None
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavauthkerbpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/authkerb.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/authkerb.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/authkerb.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> try:
</span><span class="cx"> principal = kerberos.getServerPrincipalDetails(serviceType, hostname)
</span><span class="cx"> except kerberos.KrbError, ex:
</span><del>- self.log.error("getServerPrincipalDetails: %s" % (ex[0],))
</del><ins>+ self.log.error("getServerPrincipalDetails: {ex}", ex=ex[0])
</ins><span class="cx"> raise ValueError('Authentication System Failure: %s' % (ex[0],))
</span><span class="cx">
</span><span class="cx"> self.service, self.realm = self._splitPrincipal(principal)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> service = splits[0].upper()
</span><span class="cx"> realm = splits[1]
</span><span class="cx"> except IndexError:
</span><del>- self.log.error("Invalid Kerberos principal: %s" % (principal,))
</del><ins>+ self.log.error("Invalid Kerberos principal: {principal}", principal=principal)
</ins><span class="cx"> raise ValueError('Authentication System Failure: Invalid Kerberos principal: %s' % (principal,))
</span><span class="cx">
</span><span class="cx"> service = "%s@%s" % (servicetype, service,)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx"> try:
</span><span class="cx"> kerberos.checkPassword(creds.username, creds.password, creds.service, creds.default_realm)
</span><span class="cx"> except kerberos.BasicAuthError, ex:
</span><del>- self.log.error("%s" % (ex[0],))
</del><ins>+ self.log.error("{ex}", ex=ex[0])
</ins><span class="cx"> raise error.UnauthorizedLogin("Bad credentials for: %s (%s: %s)" % (pcreds.authnURI, ex[0], ex[1],))
</span><span class="cx"> else:
</span><span class="cx"> return succeed((
</span><span class="lines">@@ -247,18 +247,18 @@
</span><span class="cx"> try:
</span><span class="cx"> _ignore_result, context = kerberos.authGSSServerInit("")
</span><span class="cx"> except kerberos.GSSError, ex:
</span><del>- self.log.error("authGSSServerInit: %s(%s)" % (ex[0][0], ex[1][0],))
</del><ins>+ self.log.error("authGSSServerInit: {ex0}({ex1})", ex0=ex[0][0], ex1=ex[1][0])
</ins><span class="cx"> raise error.LoginFailed('Authentication System Failure: %s(%s)' % (ex[0][0], ex[1][0],))
</span><span class="cx">
</span><span class="cx"> # Do the GSSAPI step and get response and username
</span><span class="cx"> try:
</span><span class="cx"> kerberos.authGSSServerStep(context, base64data)
</span><span class="cx"> except kerberos.GSSError, ex:
</span><del>- self.log.error("authGSSServerStep: %s(%s)" % (ex[0][0], ex[1][0],))
</del><ins>+ self.log.error("authGSSServerStep: {ex0}(ex1)", ex0=ex[0][0], ex1=ex[1][0])
</ins><span class="cx"> kerberos.authGSSServerClean(context)
</span><span class="cx"> raise error.UnauthorizedLogin('Bad credentials: %s(%s)' % (ex[0][0], ex[1][0],))
</span><span class="cx"> except kerberos.KrbError, ex:
</span><del>- self.log.error("authGSSServerStep: %s" % (ex[0],))
</del><ins>+ self.log.error("authGSSServerStep: {ex}", ex=ex[0])
</ins><span class="cx"> kerberos.authGSSServerClean(context)
</span><span class="cx"> raise error.UnauthorizedLogin('Bad credentials: %s' % (ex[0],))
</span><span class="cx">
</span><span class="lines">@@ -266,11 +266,11 @@
</span><span class="cx"> try:
</span><span class="cx"> service, _ignore_realm = self._splitPrincipal(targetname)
</span><span class="cx"> except ValueError:
</span><del>- self.log.error("authGSSServerTargetName invalid target name: '%s'" % (targetname,))
</del><ins>+ self.log.error("authGSSServerTargetName invalid target name: '{target}'", target=targetname)
</ins><span class="cx"> kerberos.authGSSServerClean(context)
</span><span class="cx"> raise error.UnauthorizedLogin('Bad credentials: bad target name %s' % (targetname,))
</span><span class="cx"> if service.lower() != self.service.lower():
</span><del>- self.log.error("authGSSServerTargetName mismatch got: '%s' wanted: '%s'" % (service, self.service))
</del><ins>+ self.log.error("authGSSServerTargetName mismatch got: '{got}' wanted: '{wanted}'", got=service, wanted=self.service)
</ins><span class="cx"> kerberos.authGSSServerClean(context)
</span><span class="cx"> raise error.UnauthorizedLogin('Bad credentials: wrong target name %s' % (targetname,))
</span><span class="cx">
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> try:
</span><span class="cx"> kerberos.authGSSServerClean(context)
</span><span class="cx"> except kerberos.GSSError, ex:
</span><del>- self.log.error("authGSSServerClean: %s" % (ex[0][0], ex[1][0],))
</del><ins>+ self.log.error("authGSSServerClean: {ex0}({ex1})", ex0=ex[0][0], ex1=ex[1][0])
</ins><span class="cx"> raise error.LoginFailed('Authentication System Failure %s(%s)' % (ex[0][0], ex[1][0],))
</span><span class="cx">
</span><span class="cx"> # If we successfully decoded and verified the Kerberos credentials we need to add the Kerberos
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavcaldavxmlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/caldavxml.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/caldavxml.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/caldavxml.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -122,16 +122,16 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> if self.start is not None and self.start.isDateOnly():
</span><del>- log.info("start attribute in <time-range> is not a date-time: %s" % (self.start,))
</del><ins>+ log.info("start attribute in <time-range> is not a date-time: {start}", start=self.start)
</ins><span class="cx"> return False
</span><span class="cx"> if self.end is not None and self.end.isDateOnly():
</span><del>- log.info("end attribute in <time-range> is not a date-time: %s" % (self.end,))
</del><ins>+ log.info("end attribute in <time-range> is not a date-time: {end}", end=self.end)
</ins><span class="cx"> return False
</span><span class="cx"> if self.start is not None and not self.start.utc():
</span><del>- log.info("start attribute in <time-range> is not UTC: %s" % (self.start,))
</del><ins>+ log.info("start attribute in <time-range> is not UTC: {start}", start=self.start)
</ins><span class="cx"> return False
</span><span class="cx"> if self.end is not None and not self.end.utc():
</span><del>- log.info("end attribute in <time-range> is not UTC: %s" % (self.end,))
</del><ins>+ log.info("end attribute in <time-range> is not UTC: {end}", end=self.end)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> # No other tests
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavclientgeturlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/geturl.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/geturl.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/geturl.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -113,6 +113,6 @@
</span><span class="cx"> yield whenFinished
</span><span class="cx"> response.data = protocol.data
</span><span class="cx"> else:
</span><del>- log.error("Failed getURL: %s" % (url,))
</del><ins>+ log.error("Failed getURL: {url}", url=url)
</ins><span class="cx">
</span><span class="cx"> returnValue(response)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavclientpoolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/pool.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/pool.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/pool.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -177,8 +177,10 @@
</span><span class="cx"> """
</span><span class="cx"> self._pendingConnects += 1
</span><span class="cx">
</span><del>- self.log.debug("Initating new client connection to: %r" % (
- self._endpoint,))
</del><ins>+ self.log.debug(
+ "Initiating new client connection to: {endpoint!r}",
+ endpoint=self._endpoint,
+ )
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> factory = self.clientFactory(self._reactor)
</span><span class="lines">@@ -272,12 +274,12 @@
</span><span class="cx"> response = (yield self._submitRequest(request, args, kwargs))
</span><span class="cx">
</span><span class="cx"> except (ConnectionLost, ConnectionDone, ConnectError), e:
</span><del>- self.log.error("HTTP pooled client connection error (attempt: %d) - retrying: %s" % (ctr + 1, e,))
</del><ins>+ self.log.error("HTTP pooled client connection error (attempt: {ctr}) - retrying: {ex}", ctr=ctr + 1, ex=e)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> # TODO: find the proper cause of these assertions and fix
</span><span class="cx"> except (AssertionError,), e:
</span><del>- self.log.error("HTTP pooled client connection assertion error (attempt: %d) - retrying: %s" % (ctr + 1, e,))
</del><ins>+ self.log.error("HTTP pooled client connection assertion error (attempt: {ctr}) - retrying: {ex}", ctr=ctr + 1, ex=e)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> else:
</span><span class="lines">@@ -307,7 +309,7 @@
</span><span class="cx"> elif len(self._busyClients) + self._pendingConnects >= self._maxClients:
</span><span class="cx"> d = Deferred()
</span><span class="cx"> self._pendingRequests.append((d, request, args, kwargs))
</span><del>- self.log.debug("Request queued: %s, %r, %r" % (request, args, kwargs))
</del><ins>+ self.log.debug("Request queued: {req}, {args!r}, {kwargs!r}", req=request, args=args, kwargs=kwargs)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> else:
</span><span class="lines">@@ -319,12 +321,11 @@
</span><span class="cx">
</span><span class="cx"> def _logClientStats(self):
</span><span class="cx"> self.log.debug(
</span><del>- "Clients #free: %d, #busy: %d, #pending: %d, #queued: %d" % (
- len(self._freeClients),
- len(self._busyClients),
- self._pendingConnects,
- len(self._pendingRequests)
- )
</del><ins>+ "Clients #free: {free}, #busy: {busy}, #pending: {pending}, #queued: {queued}",
+ free=len(self._freeClients),
+ busy=len(self._busyClients),
+ pending=self._pendingConnects,
+ queued=len(self._pendingRequests)
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -340,7 +341,7 @@
</span><span class="cx"> elif client in self._freeClients:
</span><span class="cx"> self._freeClients.remove(client)
</span><span class="cx">
</span><del>- self.log.debug("Removed client: %r" % (client,))
</del><ins>+ self.log.debug("Removed client: {client!r}", client=client)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> self._processPending()
</span><span class="lines">@@ -358,7 +359,7 @@
</span><span class="cx">
</span><span class="cx"> self._busyClients.add(client)
</span><span class="cx">
</span><del>- self.log.debug("Busied client: %r" % (client,))
</del><ins>+ self.log.debug("Busied client: {client!r}", client=client)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -376,7 +377,7 @@
</span><span class="cx"> if self.shutdown_deferred and self._isIdle():
</span><span class="cx"> self.shutdown_deferred.callback(None)
</span><span class="cx">
</span><del>- self.log.debug("Freed client: %r" % (client,))
</del><ins>+ self.log.debug("Freed client: {client!r}", client=client)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> self._processPending()
</span><span class="lines">@@ -386,8 +387,10 @@
</span><span class="cx"> if len(self._pendingRequests) > 0:
</span><span class="cx"> d, request, args, kwargs = self._pendingRequests.pop(0)
</span><span class="cx">
</span><del>- self.log.debug("Performing Queued Request: %s, %r, %r" % (
- request, args, kwargs))
</del><ins>+ self.log.debug(
+ "Performing Queued Request: {req}, {args!r}, {kwargs!r}",
+ req=request, args=args, kwargs=kwargs
+ )
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx"> _ign_d = self._submitRequest(request, *args, **kwargs)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavclientreverseproxypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/reverseproxy.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/reverseproxy.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/client/reverseproxy.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> @return: Deferred L{Response}
</span><span class="cx"> """
</span><span class="cx">
</span><del>- self.log.info("%s %s %s" % (request.method, request.uri, "HTTP/%s.%s" % request.clientproto))
</del><ins>+ self.log.info("{method} {uri} {proto}", method=request.method, uri=request.uri, proto="HTTP/%s.%s" % request.clientproto)
</ins><span class="cx">
</span><span class="cx"> # Check for multi-hop
</span><span class="cx"> if not self.allowMultiHop:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdatabasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/database.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/database.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/database.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -137,16 +137,20 @@
</span><span class="cx"> if (version != self._db_version()) or (dbtype != self._db_type()):
</span><span class="cx">
</span><span class="cx"> if dbtype != self._db_type():
</span><del>- log.error("Database %s has different type (%s vs. %s)"
- % (self.dbID, dbtype, self._db_type()))
</del><ins>+ log.error(
+ "Database {db} has different type ({t1} vs. {t2})",
+ db=self.dbID, t1=dbtype, t2=self._db_type()
+ )
</ins><span class="cx">
</span><span class="cx"> # Delete this index and start over
</span><span class="cx"> yield self._db_remove()
</span><span class="cx"> yield self._db_init()
</span><span class="cx">
</span><span class="cx"> elif version != self._db_version():
</span><del>- log.error("Database %s has different schema (v.%s vs. v.%s)"
- % (self.dbID, version, self._db_version()))
</del><ins>+ log.error(
+ "Database {db} has different schema (v.{v1} vs. v.{v2})",
+ db=self.dbID, v1=version, v2=self._db_version()
+ )
</ins><span class="cx">
</span><span class="cx"> # Upgrade the DB
</span><span class="cx"> yield self._db_upgrade(version)
</span><span class="lines">@@ -167,7 +171,7 @@
</span><span class="cx"> try:
</span><span class="cx"> self.pool.close()
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error whilst closing connection pool: %s" % (e,))
</del><ins>+ log.error("Error whilst closing connection pool: {ex}", ex=e)
</ins><span class="cx"> self.pool = None
</span><span class="cx"> self.initialized = False
</span><span class="cx">
</span><span class="lines">@@ -183,7 +187,7 @@
</span><span class="cx"> try:
</span><span class="cx"> yield self._db_empty_data_tables()
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error in database clean: %s" % (e,))
</del><ins>+ log.error("Error in database clean: {ex}", ex=e)
</ins><span class="cx"> self.close()
</span><span class="cx"> else:
</span><span class="cx"> break
</span><span class="lines">@@ -200,7 +204,7 @@
</span><span class="cx"> try:
</span><span class="cx"> yield self._db_execute(sql, *query_params)
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error in database execute: %s" % (e,))
</del><ins>+ log.error("Error in database execute: {ex}", ex=e)
</ins><span class="cx"> self.close()
</span><span class="cx"> else:
</span><span class="cx"> break
</span><span class="lines">@@ -217,7 +221,7 @@
</span><span class="cx"> try:
</span><span class="cx"> yield self._db_execute_script(script)
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error in database executescript: %s" % (e,))
</del><ins>+ log.error("Error in database executescript: {ex}", ex=e)
</ins><span class="cx"> self.close()
</span><span class="cx"> else:
</span><span class="cx"> break
</span><span class="lines">@@ -234,7 +238,7 @@
</span><span class="cx"> try:
</span><span class="cx"> result = (yield self._db_all_values_for_sql(sql, *query_params))
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error in database query: %s" % (e,))
</del><ins>+ log.error("Error in database query: {ex}", ex=e)
</ins><span class="cx"> self.close()
</span><span class="cx"> else:
</span><span class="cx"> break
</span><span class="lines">@@ -253,7 +257,7 @@
</span><span class="cx"> try:
</span><span class="cx"> result = (yield self._db_values_for_sql(sql, *query_params))
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error in database queryList: %s" % (e,))
</del><ins>+ log.error("Error in database queryList: {ex}", ex=e)
</ins><span class="cx"> self.close()
</span><span class="cx"> else:
</span><span class="cx"> break
</span><span class="lines">@@ -272,7 +276,7 @@
</span><span class="cx"> try:
</span><span class="cx"> result = (yield self._db_value_for_sql(sql, *query_params))
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Error in database queryOne: %s" % (e,))
</del><ins>+ log.error("Error in database queryOne: {ex}", ex=e)
</ins><span class="cx"> self.close()
</span><span class="cx"> else:
</span><span class="cx"> break
</span><span class="lines">@@ -303,7 +307,7 @@
</span><span class="cx"> """
</span><span class="cx"> Initialise the underlying database tables.
</span><span class="cx"> """
</span><del>- log.info("Initializing database %s" % (self.dbID,))
</del><ins>+ log.info("Initializing database {db}", db=self.dbID)
</ins><span class="cx">
</span><span class="cx"> # TODO we need an exclusive lock of some kind here to prevent a race condition
</span><span class="cx"> # in which multiple processes try to create the tables.
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectoryaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/augment.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/augment.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/augment.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -363,13 +363,13 @@
</span><span class="cx"> try:
</span><span class="cx"> uid = pwd.getpwnam(config.UserName).pw_uid
</span><span class="cx"> except KeyError:
</span><del>- log.error("User not found: %s" % (config.UserName,))
</del><ins>+ log.error("User not found: {user}", user=config.UserName)
</ins><span class="cx"> gid = -1
</span><span class="cx"> if config.GroupName:
</span><span class="cx"> try:
</span><span class="cx"> gid = grp.getgrnam(config.GroupName).gr_gid
</span><span class="cx"> except KeyError:
</span><del>- log.error("Group not found: %s" % (config.GroupName,))
</del><ins>+ log.error("Group not found: {grp}", grp=config.GroupName)
</ins><span class="cx"> if uid != -1 and gid != -1:
</span><span class="cx"> os.chown(xmlfile, uid, gid)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectorycalendarpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/calendar.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/calendar.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/calendar.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -305,7 +305,7 @@
</span><span class="cx"> def gotACL(wikiACL):
</span><span class="cx"> if wikiACL is not None:
</span><span class="cx"> # ACL depends on wiki server...
</span><del>- log.debug("Wiki ACL: %s" % (wikiACL.toxml(),))
</del><ins>+ log.debug("Wiki ACL: {acl}", acl=wikiACL.toxml())
</ins><span class="cx"> return succeed(wikiACL)
</span><span class="cx"> else:
</span><span class="cx"> # ...otherwise permissions are fixed, and are not subject to
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectorycommonpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/common.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/common.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/common.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -69,12 +69,14 @@
</span><span class="cx"> name = record.uid
</span><span class="cx">
</span><span class="cx"> if record is None:
</span><del>- log.debug("No directory record with UID %r" % (name,))
</del><ins>+ log.debug("No directory record with UID {name}", name=name)
</ins><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx"> if not getattr(record, self.enabledAttribute, False):
</span><del>- log.debug("Directory record %r is not enabled for %s" % (
- record, self.homeResourceTypeName))
</del><ins>+ log.debug(
+ "Directory record {rec!r} is not enabled for {type}",
+ rec=record, type=self.homeResourceTypeName
+ )
</ins><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx"> assert len(name) > 4, "Directory record has an invalid GUID: %r" % (
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectoryprincipalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/principal.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/principal.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/principal.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">
</span><span class="cx"> if wikiACL is not None:
</span><span class="cx"> # ACL depends on wiki server...
</span><del>- log.debug("Wiki ACL: %s" % (wikiACL.toxml(),))
</del><ins>+ log.debug("Wiki ACL: {acl}", acl=wikiACL.toxml())
</ins><span class="cx"> returnValue(wikiACL)
</span><span class="cx"> else:
</span><span class="cx"> # ...otherwise permissions are fixed, and are not subject to
</span><span class="lines">@@ -398,7 +398,7 @@
</span><span class="cx"> if record is not None and record.hasCalendars:
</span><span class="cx"> returnValue((yield self.principalForRecord(record)))
</span><span class="cx">
</span><del>- log.debug("No principal for calendar user address: %r" % (address,))
</del><ins>+ log.debug("No principal for calendar user address: {addr}", addr=address)
</ins><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx"> ##
</span><span class="cx">
</span><span class="cx"> def createSimilarFile(self, path):
</span><del>- log.error("Attempt to create clone %r of resource %r" % (path, self))
</del><ins>+ log.error("Attempt to create clone {path} of resource {rsrc!r}", path=path, rsrc=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -477,7 +477,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def createSimilarFile(self, path):
</span><del>- log.error("Attempt to create clone %r of resource %r" % (path, self))
</del><ins>+ log.error("Attempt to create clone {path} of resource {rsrc!r}", path=path, rsrc=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -499,8 +499,10 @@
</span><span class="cx"> for shortName in getattr(record, "shortNames", []):
</span><span class="cx"> children.append(shortName)
</span><span class="cx"> except AttributeError:
</span><del>- log.warn("Cannot list children of record type {rt}",
- rt=self.recordType.name)
</del><ins>+ log.warn(
+ "Cannot list children of record type {rt}",
+ rt=self.recordType.name
+ )
</ins><span class="cx"> returnValue(children)
</span><span class="cx">
</span><span class="cx"> else:
</span><span class="lines">@@ -562,7 +564,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def createSimilarFile(self, path):
</span><del>- log.error("Attempt to create clone %r of resource %r" % (path, self))
</del><ins>+ log.error("Attempt to create clone {path} of resource {rsrc!r}", path=path, rsrc=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -581,7 +583,7 @@
</span><span class="cx"> record = (yield self.directory.recordWithUID(primaryUID))
</span><span class="cx"> primaryPrincipal = (yield self.principalForRecord(record))
</span><span class="cx"> if primaryPrincipal is None:
</span><del>- log.info("No principal found for UID: %s" % (name,))
</del><ins>+ log.info("No principal found for UID: {name}", name=name)
</ins><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx"> if subType is None:
</span><span class="lines">@@ -1035,7 +1037,7 @@
</span><span class="cx"> if relative not in records:
</span><span class="cx"> found = (yield self.parent.principalForRecord(relative))
</span><span class="cx"> if found is None:
</span><del>- log.error("No principal found for directory record: %r" % (relative,))
</del><ins>+ log.error("No principal found for directory record: {rec!r}", rec=relative)
</ins><span class="cx"> else:
</span><span class="cx"> if proxy:
</span><span class="cx"> if proxy == "read-write":
</span><span class="lines">@@ -1194,7 +1196,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def createSimilarFile(self, path):
</span><del>- log.error("Attempt to create clone %r of resource %r" % (path, self))
</del><ins>+ log.error("Attempt to create clone {path} of resource {rsrc!r}", path=path, rsrc=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectoryutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directory/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> yield item
</span><span class="cx"> yield "\n"
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Exception while rendering: %s" % (e,))
</del><ins>+ log.error("Exception while rendering: {ex}", ex=e)
</ins><span class="cx"> Failure().printTraceback()
</span><span class="cx"> yield " ** %s **: %s\n" % (e.__class__.__name__, e)
</span><span class="cx"> if not thereAreAny:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavdirectorybackedaddressbookpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directorybackedaddressbook.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directorybackedaddressbook.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/directorybackedaddressbook.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -80,7 +80,8 @@
</span><span class="cx"> if self.directory is None:
</span><span class="cx"> log.info(
</span><span class="cx"> "Setting search directory to {principalDirectory}",
</span><del>- principalDirectory=self.principalDirectory)
</del><ins>+ principalDirectory=self.principalDirectory
+ )
</ins><span class="cx"> self.directory = self.principalDirectory
</span><span class="cx"> # future: instantiate another directory based on /Search/Contacts (?)
</span><span class="cx">
</span><span class="lines">@@ -162,8 +163,10 @@
</span><span class="cx"> Get vCards for a given addressBookFilter and addressBookQuery
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug("doAddressBookDirectoryQuery: directory={directory} addressBookFilter={addressBookFilter}, addressBookQuery={addressBookQuery}, maxResults={maxResults}",
- directory=self.directory, addressBookFilter=addressBookFilter, addressBookQuery=addressBookQuery, maxResults=maxResults)
</del><ins>+ log.debug(
+ "doAddressBookDirectoryQuery: directory={directory} addressBookFilter={addressBookFilter}, addressBookQuery={addressBookQuery}, maxResults={maxResults}",
+ directory=self.directory, addressBookFilter=addressBookFilter, addressBookQuery=addressBookQuery, maxResults=maxResults
+ )
</ins><span class="cx"> results = []
</span><span class="cx"> limited = False
</span><span class="cx"> maxQueryRecords = 0
</span><span class="lines">@@ -232,8 +235,10 @@
</span><span class="cx"> allRecords = set()
</span><span class="cx"> if fields:
</span><span class="cx"> records = yield self.directory.recordsMatchingFields(fields, operand, queryRecordType)
</span><del>- log.debug("doAddressBookDirectoryQuery: recordsMatchingFields({f}, {o}): #records={n}, records={records!r}",
- f=fields, o=operand, n=len(records), records=records)
</del><ins>+ log.debug(
+ "doAddressBookDirectoryQuery: recordsMatchingFields({f}, {o}): #records={n}, records={records!r}",
+ f=fields, o=operand, n=len(records), records=records
+ )
</ins><span class="cx"> allRecords = set(records)
</span><span class="cx"> else:
</span><span class="cx"> recordTypes = set([queryRecordType]) if queryRecordType else set(self.directory.recordTypes()) & set(recordTypeToVCardKindMap.keys())
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavextensionspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/extensions.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/extensions.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/extensions.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx"> # Only handle Depth: 0
</span><span class="cx"> depth = request.headers.getHeader("depth", "0")
</span><span class="cx"> if depth != "0":
</span><del>- log.error("Error in principal-property-search REPORT, Depth set to %s" % (depth,))
</del><ins>+ log.error("Error in principal-property-search REPORT, Depth set to {depth}", depth=depth)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, "Depth %s not allowed" % (depth,)))
</span><span class="cx">
</span><span class="cx"> # Get any limit value from xml
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx"> # Only handle Depth: 0
</span><span class="cx"> depth = request.headers.getHeader("depth", "0")
</span><span class="cx"> if depth != "0":
</span><del>- log.error("Error in calendarserver-principal-search REPORT, Depth set to %s" % (depth,))
</del><ins>+ log.error("Error in calendarserver-principal-search REPORT, Depth set to {depth}", depth=depth)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, "Depth %s not allowed" % (depth,)))
</span><span class="cx">
</span><span class="cx"> tokens, context, applyTo, clientLimit, propElement = extractCalendarServerPrincipalSearchData(calendarserver_principal_search)
</span><span class="lines">@@ -484,9 +484,11 @@
</span><span class="cx"> f.trap(HTTPError)
</span><span class="cx"> code = f.value.response.code
</span><span class="cx"> if code == responsecode.NOT_FOUND:
</span><del>- log.error("Property {p} was returned by listProperties() "
- "but does not exist for resource {r}.",
- p=name, r=self.resource)
</del><ins>+ log.error(
+ "Property {name} was returned by listProperties() "
+ "but does not exist for resource {rsrc!r}.",
+ name=name, rsrc=self.resource
+ )
</ins><span class="cx"> return (name, None)
</span><span class="cx"> if code == responsecode.UNAUTHORIZED:
</span><span class="cx"> return (name, accessDeniedValue)
</span><span class="lines">@@ -954,7 +956,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def get(self, qname, uid=None):
</span><del>- # self.log.debug("Get: %r, %r" % (self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Get: {p}, {n}", p=self.resource.fp.path, n=qname)
</ins><span class="cx">
</span><span class="cx"> cache = self._cache()
</span><span class="cx">
</span><span class="lines">@@ -963,7 +965,7 @@
</span><span class="cx"> if cachedQname in cache:
</span><span class="cx"> property = cache.get(cachedQname, None)
</span><span class="cx"> if property is None:
</span><del>- self.log.debug("Cache miss: %r, %r, %r" % (self, self.resource.fp.path, qname))
</del><ins>+ self.log.debug("Cache miss: {s!r}, {p}, {n}", s=self, p=self.resource.fp.path, n=qname)
</ins><span class="cx"> try:
</span><span class="cx"> property = self.propertyStore.get(qname, uid)
</span><span class="cx"> except HTTPError:
</span><span class="lines">@@ -977,7 +979,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def set(self, property, uid=None):
</span><del>- # self.log.debug("Set: %r, %r" % (self.resource.fp.path, property))
</del><ins>+ # self.log.debug("Set: {p}, {prop!r}", p=self.resource.fp.path, prop=property)
</ins><span class="cx">
</span><span class="cx"> cache = self._cache()
</span><span class="cx">
</span><span class="lines">@@ -989,7 +991,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def contains(self, qname, uid=None):
</span><del>- # self.log.debug("Contains: %r, %r" % (self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Contains: {p}, {n}", p=self.resource.fp.path, n=qname)
</ins><span class="cx">
</span><span class="cx"> cachedQname = qname + (uid,)
</span><span class="cx">
</span><span class="lines">@@ -1002,14 +1004,14 @@
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> if cachedQname in cache:
</span><del>- # self.log.debug("Contains cache hit: %r, %r, %r" % (self, self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Contains cache hit: {s!r}, {p}, {n}", s=self, p=self.resource.fp.path, n=qname)
</ins><span class="cx"> return True
</span><span class="cx"> else:
</span><span class="cx"> return False
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def delete(self, qname, uid=None):
</span><del>- # self.log.debug("Delete: %r, %r" % (self.resource.fp.path, qname))
</del><ins>+ # self.log.debug("Delete: {p}, {n}", p=self.resource.fp.path, n=qname)
</ins><span class="cx">
</span><span class="cx"> cachedQname = qname + (uid,)
</span><span class="cx">
</span><span class="lines">@@ -1020,7 +1022,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def list(self, uid=None, filterByUID=True):
</span><del>- # self.log.debug("List: %r" % (self.resource.fp.path,))
</del><ins>+ # self.log.debug("List: {p}", p=self.resource.fp.path)
</ins><span class="cx"> keys = self._cache().iterkeys()
</span><span class="cx"> if filterByUID:
</span><span class="cx"> return [
</span><span class="lines">@@ -1034,7 +1036,7 @@
</span><span class="cx">
</span><span class="cx"> def _cache(self):
</span><span class="cx"> if not hasattr(self, "_data"):
</span><del>- # self.log.debug("Cache init: %r" % (self.resource.fp.path,))
</del><ins>+ # self.log.debug("Cache init: {p}", p=self.resource.fp.path)
</ins><span class="cx"> self._data = dict(
</span><span class="cx"> (name, None)
</span><span class="cx"> for name in self.propertyStore.list(filterByUID=False)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavfreebusyurlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/freebusyurl.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/freebusyurl.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/freebusyurl.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -260,7 +260,7 @@
</span><span class="cx"> try:
</span><span class="cx"> inbox = (yield request.locateResource(inboxURL))
</span><span class="cx"> except:
</span><del>- log.error("No schedule inbox for principal: %s" % (principal,))
</del><ins>+ log.error("No schedule inbox for principal: {p}", p=principal)
</ins><span class="cx"> inbox = None
</span><span class="cx"> if inbox is None:
</span><span class="cx"> raise HTTPError(StatusResponse(responsecode.INTERNAL_SERVER_ERROR, "No schedule inbox for principal: %s" % (principal,)))
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavicalpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/ical.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/ical.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/ical.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -1892,10 +1892,10 @@
</span><span class="cx"> cannot be fixed.
</span><span class="cx"> """
</span><span class="cx"> if self.name() != "VCALENDAR":
</span><del>- log.debug("Not a calendar: {0}".format(self,))
</del><ins>+ log.debug("Not a calendar: {s!r}", s=self)
</ins><span class="cx"> raise InvalidICalendarDataError("Not a calendar")
</span><span class="cx"> if not self.resourceType():
</span><del>- log.debug("Unknown resource type: {0}".format(self,))
</del><ins>+ log.debug("Unknown resource type: {s!r}", s=self)
</ins><span class="cx"> raise InvalidICalendarDataError("Unknown resource type")
</span><span class="cx">
</span><span class="cx"> # Do underlying iCalendar library validation with data fix
</span><span class="lines">@@ -1908,11 +1908,11 @@
</span><span class="cx"> unfixed.extend(runfixed)
</span><span class="cx">
</span><span class="cx"> if unfixed:
</span><del>- log.debug("Calendar data had unfixable problems:\n {0}".format("\n ".join(unfixed),))
</del><ins>+ log.debug("Calendar data had unfixable problems:\n {d}", d="\n ".join(unfixed))
</ins><span class="cx"> if doRaise:
</span><span class="cx"> raise InvalidICalendarDataError("Calendar data had unfixable problems:\n {0}".format("\n ".join(unfixed),))
</span><span class="cx"> if fixed:
</span><del>- log.debug("Calendar data had fixable problems:\n {0}".format("\n ".join(fixed),))
</del><ins>+ log.debug("Calendar data had fixable problems:\n {d}", d="\n ".join(fixed))
</ins><span class="cx">
</span><span class="cx"> return fixed, unfixed
</span><span class="cx">
</span><span class="lines">@@ -2099,7 +2099,7 @@
</span><span class="cx"> # If it does we will have to reinstate this check but only after we have checked for implicit.
</span><span class="cx"> # UNCOMMENT OUT master_recurring AND got_override ASSIGNMENTS ABOVE
</span><span class="cx"> # if got_override and got_master and not master_recurring:
</span><del>-# msg = "Calendar resources must have a recurring master component if there is an overridden one (%s)" % (subcomponent.propertyValue("UID"),)
</del><ins>+# msg = "Calendar resources must have a recurring master component if there is an overridden one ({uid})".format(uid=subcomponent.propertyValue("UID"),)
</ins><span class="cx"> # log.debug(msg)
</span><span class="cx"> # raise InvalidICalendarDataError(msg)
</span><span class="cx">
</span><span class="lines">@@ -2131,7 +2131,7 @@
</span><span class="cx"> for timezone in timezones:
</span><span class="cx"> if timezone not in timezone_refs:
</span><span class="cx"> log.debug(
</span><del>- "Timezone {0} is not referenced by any non-timezone component".format(timezone,)
</del><ins>+ "Timezone {tz} is not referenced by any non-timezone component", tz=timezone
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> # TZIDs without a VTIMEZONE must be available in the server's TZ database
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavlocalizationpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/localization.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/localization.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/localization.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -383,7 +383,7 @@
</span><span class="cx"> # Do we have an Apple translations directory?
</span><span class="cx"> if lprojRoot and gnuRoot and os.path.exists(lprojRoot):
</span><span class="cx">
</span><del>- log.info("Looking for Apple .lproj directories in %s" % (lprojRoot,))
</del><ins>+ log.info("Looking for Apple .lproj directories in {r}", r=lprojRoot)
</ins><span class="cx">
</span><span class="cx"> # Make sure the gnutext translations directory exists
</span><span class="cx"> if not os.path.exists(gnuRoot):
</span><span class="lines">@@ -391,8 +391,9 @@
</span><span class="cx"> os.mkdir(gnuRoot)
</span><span class="cx"> except OSError:
</span><span class="cx"> log.warn(
</span><del>- "Could not create gnuttext translation directory: %s"
- % (gnuRoot,))
</del><ins>+ "Could not create gnuttext translation directory: {r}",
+ r=gnuRoot,
+ )
</ins><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> # Scan for Apple translations (directories ending in .lproj)
</span><span class="lines">@@ -413,16 +414,16 @@
</span><span class="cx"> os.stat(stringsFile).st_mtime >
</span><span class="cx"> os.stat(moFile).st_mtime
</span><span class="cx"> ):
</span><del>- log.info("Converting %s to %s" % (stringsFile, moFile))
</del><ins>+ log.info("Converting {s} to {m}", s=stringsFile, m=moFile)
</ins><span class="cx"> try:
</span><span class="cx"> convertStringsFile(stringsFile, moFile)
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.error(
</span><del>- "Failed to convert %s to %s: %s" %
- (stringsFile, moFile, e)
</del><ins>+ "Failed to convert {s} to {m}: {ex}",
+ s=stringsFile, m=moFile, ex=e,
</ins><span class="cx"> )
</span><span class="cx"> else:
</span><del>- log.info("%s is up to date" % (moFile,))
</del><ins>+ log.info("{m} is up to date", m=moFile)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcacheclientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheclient.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheclient.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheclient.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx"> log.debug("Memcacheclient check-and-set failed")
</span><span class="cx"> raise TokenMismatchError(key)
</span><span class="cx">
</span><del>- log.error("Memcacheclient %s command failed with result (%s)" % (cmd, result))
</del><ins>+ log.error("Memcacheclient {cmd} command failed with result ({r})", cmd=cmd, r=result)
</ins><span class="cx">
</span><span class="cx"> return False
</span><span class="cx">
</span><span class="lines">@@ -1276,7 +1276,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def mark_dead(self, reason):
</span><del>- log.error("Memcacheclient socket marked dead (%s)" % (reason,))
</del><ins>+ log.error("Memcacheclient socket marked dead ({r})", r=reason)
</ins><span class="cx"> self.debuglog("MemCache: %s: %s. Marking dead." % (self, reason))
</span><span class="cx"> self.deaduntil = time.time() + _Host._DEAD_RETRY
</span><span class="cx"> self.close_socket()
</span><span class="lines">@@ -1294,13 +1294,13 @@
</span><span class="cx"> try:
</span><span class="cx"> s.connect(self.address)
</span><span class="cx"> except socket.timeout, msg:
</span><del>- log.error("Memcacheclient _get_socket() connection timed out (%s)" % (msg,))
</del><ins>+ log.error("Memcacheclient _get_socket() connection timed out ({m})", m=msg)
</ins><span class="cx"> self.mark_dead("connect: %s" % msg)
</span><span class="cx"> return None
</span><span class="cx"> except socket.error, msg:
</span><span class="cx"> if isinstance(msg, tuple):
</span><span class="cx"> msg = msg[1]
</span><del>- log.error("Memcacheclient _get_socket() connection error (%s)" % (msg,))
</del><ins>+ log.error("Memcacheclient _get_socket() connection error ({m})", m=msg)
</ins><span class="cx"> self.mark_dead("connect: %s" % msg)
</span><span class="cx"> return None
</span><span class="cx"> self.socket = s
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcachelockpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachelock.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachelock.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachelock.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -68,19 +68,19 @@
</span><span class="cx"> if result:
</span><span class="cx"> self._hasLock = True
</span><span class="cx"> if waiting:
</span><del>- self.log.debug("Got lock after waiting on %s" % (self._locktoken,))
</del><ins>+ self.log.debug("Got lock after waiting on {t}", t=self._locktoken)
</ins><span class="cx"> break
</span><span class="cx">
</span><span class="cx"> if self._timeout and time.time() < timeout_at:
</span><span class="cx"> waiting = True
</span><del>- self.log.debug("Waiting for lock on %s" % (self._locktoken,))
</del><ins>+ self.log.debug("Waiting for lock on {t}", t=self._locktoken)
</ins><span class="cx"> pause = Deferred()
</span><span class="cx"> def _timedDeferred():
</span><span class="cx"> pause.callback(True)
</span><span class="cx"> reactor.callLater(self._retry_interval, _timedDeferred)
</span><span class="cx"> yield pause
</span><span class="cx"> else:
</span><del>- self.log.debug("Timed out lock after waiting on %s" % (self._locktoken,))
</del><ins>+ self.log.debug("Timed out lock after waiting on {t}", t=self._locktoken)
</ins><span class="cx"> raise MemcacheLockTimeoutError()
</span><span class="cx">
</span><span class="cx"> returnValue(True)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcachepoolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachepool.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachepool.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcachepool.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> # The reactor is stopping; don't reconnect
</span><span class="cx"> return
</span><span class="cx">
</span><del>- self.log.error("MemCache connection lost: %s" % (reason,))
</del><ins>+ self.log.error("MemCache connection lost: {r}", r=reason)
</ins><span class="cx"> if self._protocolInstance is not None:
</span><span class="cx"> self.connectionPool.clientBusy(self._protocolInstance)
</span><span class="cx">
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> """
</span><span class="cx"> Notify the connectionPool that we're unable to connect
</span><span class="cx"> """
</span><del>- self.log.error("MemCache connection failed: %s" % (reason,))
</del><ins>+ self.log.error("MemCache connection failed: {r}", r=reason)
</ins><span class="cx"> if self._protocolInstance is not None:
</span><span class="cx"> self.connectionPool.clientBusy(self._protocolInstance)
</span><span class="cx">
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> @return: A L{Deferred} that fires with the L{IProtocol} instance.
</span><span class="cx"> """
</span><span class="cx"> self.log.debug(
</span><del>- "Initiating new client connection to: %r" % (self._endpoint,)
</del><ins>+ "Initiating new client connection to: {r!r}", r=self._endpoint
</ins><span class="cx"> )
</span><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="lines">@@ -245,10 +245,10 @@
</span><span class="cx"> message and free the client.
</span><span class="cx"> """
</span><span class="cx"> self.log.error(
</span><del>- "Memcache error: %s; request: %s %s" % (
- failure.value, command,
- " ".join(args)[:self.REQUEST_LOGGING_SIZE],
- )
</del><ins>+ "Memcache error: {ex}; request: {cmd} {args}",
+ ex=failure.value,
+ cmd=command,
+ args=" ".join(args)[:self.REQUEST_LOGGING_SIZE],
</ins><span class="cx"> )
</span><span class="cx"> self.clientFree(client)
</span><span class="cx">
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx"> d = Deferred()
</span><span class="cx"> self._commands.append((d, command, args, kwargs))
</span><span class="cx"> self.log.debug(
</span><del>- "Command queued: %s, %r, %r" % (command, args, kwargs)
</del><ins>+ "Command queued: {c}, {a!r}, {k!r}", c=command, a=args, k=kwargs
</ins><span class="cx"> )
</span><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="lines">@@ -304,12 +304,11 @@
</span><span class="cx">
</span><span class="cx"> def _logClientStats(self):
</span><span class="cx"> self.log.debug(
</span><del>- "Clients #free: %d, #busy: %d, #pending: %d, #queued: %d" % (
- len(self._freeClients),
- len(self._busyClients),
- self._pendingConnects,
- len(self._commands),
- )
</del><ins>+ "Clients #free: {f}, #busy: {b}, #pending: {p}, #queued: {q}",
+ f=len(self._freeClients),
+ b=len(self._busyClients),
+ p=self._pendingConnects,
+ q=len(self._commands),
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -325,7 +324,7 @@
</span><span class="cx"> elif client in self._freeClients:
</span><span class="cx"> self._freeClients.remove(client)
</span><span class="cx">
</span><del>- self.log.debug("Removed client: %r" % (client,))
</del><ins>+ self.log.debug("Removed client: {c!r}", c=client)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -341,7 +340,7 @@
</span><span class="cx">
</span><span class="cx"> self._busyClients.add(client)
</span><span class="cx">
</span><del>- self.log.debug("Busied client: %r" % (client,))
</del><ins>+ self.log.debug("Busied client: {c!r}", c=client)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -363,8 +362,8 @@
</span><span class="cx"> d, command, args, kwargs = self._commands.pop(0)
</span><span class="cx">
</span><span class="cx"> self.log.debug(
</span><del>- "Performing Queued Command: %s, %r, %r"
- % (command, args, kwargs)
</del><ins>+ "Performing Queued Command: {c}, {a}, {k}",
+ c=command, a=args, k=kwargs,
</ins><span class="cx"> )
</span><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="lines">@@ -373,7 +372,7 @@
</span><span class="cx">
</span><span class="cx"> _ign_d.addCallback(d.callback)
</span><span class="cx">
</span><del>- self.log.debug("Freed client: %r" % (client,))
</del><ins>+ self.log.debug("Freed client: {c!r}", c=client)
</ins><span class="cx"> self._logClientStats()
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcachepropspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheprops.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheprops.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacheprops.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> try:
</span><span class="cx"> childCache, token = propertyCache[key]
</span><span class="cx"> except KeyError:
</span><del>- self.log.debug("No child property cache for %s" % (child,))
</del><ins>+ self.log.debug("No child property cache for {c!r}", c=child)
</ins><span class="cx"> childCache, token = ({}, None)
</span><span class="cx">
</span><span class="cx"> # message = "No child property cache for %s" % (child,)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> else:
</span><span class="cx"> return {}
</span><span class="cx">
</span><del>- self.log.debug("Loading cache for %s" % (self.collection,))
</del><ins>+ self.log.debug("Loading cache for {c}", c=self.collection)
</ins><span class="cx">
</span><span class="cx"> client = self.memcacheClient()
</span><span class="cx"> assert client is not None, "OMG no cache!"
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def _storeCache(self, cache):
</span><del>- self.log.debug("Storing cache for %s" % (self.collection,))
</del><ins>+ self.log.debug("Storing cache for {c}", c=self.collection)
</ins><span class="cx">
</span><span class="cx"> values = dict((
</span><span class="cx"> (self._keyForPath(path), props)
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> elif not childNames:
</span><span class="cx"> return {}
</span><span class="cx">
</span><del>- self.log.debug("Building cache for %s" % (self.collection,))
</del><ins>+ self.log.debug("Building cache for {c}", c=self.collection)
</ins><span class="cx">
</span><span class="cx"> cache = {}
</span><span class="cx">
</span><span class="lines">@@ -372,29 +372,32 @@
</span><span class="cx"> "No such property: %s%s" % (uid if uid else "", encodeXMLName(*qname))
</span><span class="cx"> ))
</span><span class="cx">
</span><del>- self.log.debug("Read for %s%s on %s" % (
- ("{%s}:" % (uid,)) if uid else "",
- qname,
- self.childPropertyStore.resource.fp.path
- ))
</del><ins>+ self.log.debug(
+ "Read for {u}{q} on {p}",
+ u=("{%s}:" % (uid,)) if uid else "",
+ q=qname,
+ p=self.childPropertyStore.resource.fp.path
+ )
</ins><span class="cx"> return self.childPropertyStore.get(qname, uid=uid)
</span><span class="cx">
</span><span class="cx"> def set(self, property, uid=None):
</span><del>- self.log.debug("Write for %s%s on %s" % (
- ("{%s}:" % (uid,)) if uid else "",
- property.qname(),
- self.childPropertyStore.resource.fp.path
- ))
</del><ins>+ self.log.debug(
+ "Write for {u}{q} on {p}",
+ u=("{%s}:" % (uid,)) if uid else "",
+ q=property.qname(),
+ p=self.childPropertyStore.resource.fp.path
+ )
</ins><span class="cx">
</span><span class="cx"> self.parentPropertyCollection.setProperty(self.child, property, uid)
</span><span class="cx"> self.childPropertyStore.set(property, uid=uid)
</span><span class="cx">
</span><span class="cx"> def delete(self, qname, uid=None):
</span><del>- self.log.debug("Delete for %s%s on %s" % (
- ("{%s}:" % (uid,)) if uid else "",
- qname,
- self.childPropertyStore.resource.fp.path
- ))
</del><ins>+ self.log.debug(
+ "Delete for {u}{q} on {p}",
+ u=("{%s}:" % (uid,)) if uid else "",
+ q=qname,
+ p=self.childPropertyStore.resource.fp.path,
+ )
</ins><span class="cx">
</span><span class="cx"> self.parentPropertyCollection.deleteProperty(self.child, qname, uid)
</span><span class="cx"> self.childPropertyStore.delete(qname, uid=uid)
</span><span class="lines">@@ -405,11 +408,12 @@
</span><span class="cx"> qnameuid = qname + (uid,)
</span><span class="cx"> return qnameuid in propertyCache
</span><span class="cx">
</span><del>- self.log.debug("Contains for %s%s on %s" % (
- ("{%s}:" % (uid,)) if uid else "",
- qname,
- self.childPropertyStore.resource.fp.path,
- ))
</del><ins>+ self.log.debug(
+ "Contains for {u}{q} on {p}",
+ u=("{%s}:" % (uid,)) if uid else "",
+ q=qname,
+ p=self.childPropertyStore.resource.fp.path,
+ )
</ins><span class="cx"> return self.childPropertyStore.contains(qname, uid=uid)
</span><span class="cx">
</span><span class="cx"> def list(self, uid=None, filterByUID=True, cache=True):
</span><span class="lines">@@ -425,6 +429,7 @@
</span><span class="cx"> else:
</span><span class="cx"> return results
</span><span class="cx">
</span><del>- self.log.debug("List for %s"
- % (self.childPropertyStore.resource.fp.path,))
</del><ins>+ self.log.debug(
+ "List for{p}", p=self.childPropertyStore.resource.fp.path
+ )
</ins><span class="cx"> return self.childPropertyStore.list(uid=uid, filterByUID=filterByUID)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmemcacherpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacher.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacher.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/memcacher.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx"> my_value = value
</span><span class="cx"> if self._pickle:
</span><span class="cx"> my_value = cPickle.dumps(value)
</span><del>- self.log.debug("Adding Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Adding Cache Token for {k!r}", k=key)
</ins><span class="cx"> return proto.add('%s:%s' % (self._namespace, self._normalizeKey(key)), my_value, expireTime=expireTime)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx"> my_value = value
</span><span class="cx"> if self._pickle:
</span><span class="cx"> my_value = cPickle.dumps(value)
</span><del>- self.log.debug("Setting Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Setting Cache Token for {k!r}", k=key)
</ins><span class="cx"> return proto.set('%s:%s' % (self._namespace, self._normalizeKey(key)), my_value, expireTime=expireTime)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> my_value = value
</span><span class="cx"> if self._pickle:
</span><span class="cx"> my_value = cPickle.dumps(value)
</span><del>- self.log.debug("Setting Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Setting Cache Token for {k!r}", k=key)
</ins><span class="cx"> return proto.checkAndSet('%s:%s' % (self._namespace, self._normalizeKey(key)), my_value, cas, expireTime=expireTime)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -326,24 +326,24 @@
</span><span class="cx"> value = (identifier, value)
</span><span class="cx"> return value
</span><span class="cx">
</span><del>- self.log.debug("Getting Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Getting Cache Token for {k!r}", k=key)
</ins><span class="cx"> d = self._getMemcacheProtocol().get('%s:%s' % (self._namespace, self._normalizeKey(key)), withIdentifier=withIdentifier)
</span><span class="cx"> d.addCallback(_gotit, withIdentifier)
</span><span class="cx"> return d
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def delete(self, key):
</span><del>- self.log.debug("Deleting Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Deleting Cache Token for {k!r}", k=key)
</ins><span class="cx"> return self._getMemcacheProtocol().delete('%s:%s' % (self._namespace, self._normalizeKey(key)))
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def incr(self, key, delta=1):
</span><del>- self.log.debug("Incrementing Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Incrementing Cache Token for {k!r}", k=key)
</ins><span class="cx"> return self._getMemcacheProtocol().incr('%s:%s' % (self._namespace, self._normalizeKey(key)), delta)
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def decr(self, key, delta=1):
</span><del>- self.log.debug("Decrementing Cache Token for %r" % (key,))
</del><ins>+ self.log.debug("Decrementing Cache Token for {k!r}", k=key)
</ins><span class="cx"> return self._getMemcacheProtocol().incr('%s:%s' % (self._namespace, self._normalizeKey(key)), delta)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodmkcalendarpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcalendar.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcalendar.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcalendar.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> yield parent.authorize(request, (davxml.Bind(),))
</span><span class="cx">
</span><span class="cx"> if self.exists():
</span><del>- log.error("Attempt to create collection where resource exists: %s" % (self,))
</del><ins>+ log.error("Attempt to create collection where resource exists: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (davxml.dav_namespace, "resource-must-be-null"),
</span><span class="lines">@@ -59,8 +59,7 @@
</span><span class="cx"> ))
</span><span class="cx">
</span><span class="cx"> if not parent.isCollection():
</span><del>- log.error("Attempt to create collection with non-collection parent: %s"
- % (self,))
</del><ins>+ log.error("Attempt to create collection with non-collection parent: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.CONFLICT,
</span><span class="cx"> (caldavxml.caldav_namespace, "calendar-collection-location-ok"),
</span><span class="lines">@@ -74,7 +73,7 @@
</span><span class="cx"> doc = (yield davXMLFromStream(request.stream))
</span><span class="cx"> yield self.createCalendar(request)
</span><span class="cx"> except ValueError, e:
</span><del>- log.error("Error while handling MKCALENDAR: %s" % (e,))
</del><ins>+ log.error("Error while handling MKCALENDAR: {ex}", ex=e)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, str(e)))
</span><span class="cx">
</span><span class="cx"> set_supported_component_set = False
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodmkcolpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcol.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcol.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/mkcol.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -54,8 +54,7 @@
</span><span class="cx"> yield parent.authorize(request, (davxml.Bind(),))
</span><span class="cx">
</span><span class="cx"> if self.exists():
</span><del>- log.error("Attempt to create collection where resource exists: %s"
- % (self,))
</del><ins>+ log.error("Attempt to create collection where resource exists: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (davxml.dav_namespace, "resource-must-be-null"),
</span><span class="lines">@@ -63,8 +62,7 @@
</span><span class="cx"> ))
</span><span class="cx">
</span><span class="cx"> if not parent.isCollection():
</span><del>- log.error("Attempt to create collection with non-collection parent: %s"
- % (self,))
</del><ins>+ log.error("Attempt to create collection with non-collection parent: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.CONFLICT,
</span><span class="cx"> (davxml.dav_namespace, "collection-location-ok"),
</span><span class="lines">@@ -99,7 +97,7 @@
</span><span class="cx"> try:
</span><span class="cx"> doc = (yield davXMLFromStream(request.stream))
</span><span class="cx"> except ValueError, e:
</span><del>- log.error("Error while handling MKCOL: %s" % (e,))
</del><ins>+ log.error("Error while handling MKCOL: {ex}", ex=e)
</ins><span class="cx"> # TODO: txweb2.dav 'MKCOL' tests demand this particular response
</span><span class="cx"> # code, but should we really be looking at the XML content or the
</span><span class="cx"> # content-type header? It seems to me like this ought to be considered
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodpostpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/post.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/post.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/post.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">
</span><span class="cx"> # POST can only target an existing resource
</span><span class="cx"> if not self.exists():
</span><del>- log.error("Resource not found: %s" % (self,))
</del><ins>+ log.error("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> # POST can support many different APIs
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodpropfindpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/propfind.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/propfind.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/propfind.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> parent = (yield request.locateResource(parentURL))
</span><span class="cx"> yield parent.authorize(request, (davxml.Bind(),))
</span><span class="cx">
</span><del>- log.error("Resource not found: %s" % (self,))
</del><ins>+ log.error("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> #
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> try:
</span><span class="cx"> doc = (yield davXMLFromStream(request.stream))
</span><span class="cx"> except ValueError, e:
</span><del>- log.error("Error while handling PROPFIND body: %s" % (e,))
</del><ins>+ log.error("Error while handling PROPFIND body: {ex}", ex=e)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, str(e)))
</span><span class="cx">
</span><span class="cx"> if doc is None:
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> try:
</span><span class="cx"> resource_properties = (yield resource.listProperties(request))
</span><span class="cx"> except:
</span><del>- log.error("Unable to get properties for resource %r" % (resource,))
</del><ins>+ log.error("Unable to get properties for resource {r!r}", r=resource)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> properties_by_status = {
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreportpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> Respond to a REPORT request. (RFC 3253, section 3.6)
</span><span class="cx"> """
</span><span class="cx"> if not self.exists():
</span><del>- log.error("Resource not found: %s" % (self,))
</del><ins>+ log.error("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(responsecode.NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> #
</span><span class="lines">@@ -117,8 +117,10 @@
</span><span class="cx"> #
</span><span class="cx"> # Requested report is not supported.
</span><span class="cx"> #
</span><del>- log.error("Unsupported REPORT {name} for resource {resource} (no method {method})",
- name=encodeXMLName(namespace, name), resource=self, method=method_name)
</del><ins>+ log.error(
+ "Unsupported REPORT {name} for resource {resource} (no method {method})",
+ name=encodeXMLName(namespace, name), resource=self, method=method_name,
+ )
</ins><span class="cx">
</span><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_addressbook_querypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_addressbook_query.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_addressbook_query.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_addressbook_query.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">
</span><span class="cx"> # Verify that the filter element is valid
</span><span class="cx"> if (filter is None) or not filter.valid():
</span><del>- log.error("Invalid filter element: %r" % (filter,))
</del><ins>+ log.error("Invalid filter element: {f!r}", f=filter)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (carddav_namespace, "valid-filter"),
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_calendar_querypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_calendar_query.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_calendar_query.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_calendar_query.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> if not self.isCollection():
</span><span class="cx"> parent = (yield self.locateParent(request, request.uri))
</span><span class="cx"> if not parent.isPseudoCalendarCollection():
</span><del>- log.error("calendar-query report is not allowed on a resource outside of a calendar collection %s" % (self,))
</del><ins>+ log.error("calendar-query report is not allowed on a resource outside of a calendar collection {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Must be calendar collection or calendar resource"))
</span><span class="cx">
</span><span class="cx"> responses = []
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">
</span><span class="cx"> # Verify that the filter element is valid
</span><span class="cx"> if (filter is None) or not filter.valid():
</span><del>- log.error("Invalid filter element: %r" % (xmlfilter,))
</del><ins>+ log.error("Invalid filter element: {f!r}", f=xmlfilter)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (caldav_namespace, "valid-filter"),
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx"> # of one of these resources in another request. In this
</span><span class="cx"> # case, we ignore the now missing resource rather
</span><span class="cx"> # than raise an error for the entire report.
</span><del>- log.error("Missing resource during query: %s" % (href,))
</del><ins>+ log.error("Missing resource during query: {h}", h=href)
</ins><span class="cx">
</span><span class="cx"> # Check whether supplied resource is a calendar or a calendar object resource
</span><span class="cx"> if calresource.isPseudoCalendarCollection():
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_freebusypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_freebusy.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_freebusy.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_freebusy.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> (CalDAV-access-09, section 7.8)
</span><span class="cx"> """
</span><span class="cx"> if not self.isCollection():
</span><del>- log.error("freebusy report is only allowed on collection resources %s" % (self,))
</del><ins>+ log.error("freebusy report is only allowed on collection resources {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Not a calendar collection"))
</span><span class="cx">
</span><span class="cx"> if freebusy.qname() != (caldavxml.caldav_namespace, "free-busy-query"):
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavmethodreport_sync_collectionpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_sync_collection.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_sync_collection.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/method/report_sync_collection.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">
</span><span class="cx"> # These resource support the report
</span><span class="cx"> if not config.EnableSyncReport or element.Report(element.SyncCollection(),) not in self.supportedReports():
</span><del>- log.error("sync-collection report is only allowed on calendar/inbox/addressbook/notification collection resources %s" % (self,))
</del><ins>+ log.error("sync-collection report is only allowed on calendar/inbox/addressbook/notification collection resources {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> element.SupportedReport(),
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> descriptor = "Depth header without DAV:sync-level"
</span><span class="cx">
</span><span class="cx"> if depth not in ("1", "infinity"):
</span><del>- log.error("sync-collection report with invalid depth header: %s" % (depth,))
</del><ins>+ log.error("sync-collection report with invalid depth header: {d}", d=depth)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, "Invalid %s value" % (descriptor,)))
</span><span class="cx">
</span><span class="cx"> propertyreq = sync_collection.property.children if sync_collection.property else None
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> # of one of these resources in another request. In this
</span><span class="cx"> # case, we ignore the now missing resource rather
</span><span class="cx"> # than raise an error for the entire report.
</span><del>- log.error("Missing resource during sync: %s" % (href,))
</del><ins>+ log.error("Missing resource during sync: {h}", h=href)
</ins><span class="cx">
</span><span class="cx"> for child, child_uri in forbidden_resources:
</span><span class="cx"> href = element.HRef.fromString(child_uri)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx"> # of one of these resources in another request. In this
</span><span class="cx"> # case, we ignore the now missing resource rather
</span><span class="cx"> # than raise an error for the entire report.
</span><del>- log.error("Missing resource during sync: %s" % (href,))
</del><ins>+ log.error("Missing resource during sync: {h}", h=href)
</ins><span class="cx">
</span><span class="cx"> for name in removed:
</span><span class="cx"> href = element.HRef.fromString(joinURL(request.uri, name))
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/resource.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/resource.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/resource.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -1395,12 +1395,12 @@
</span><span class="cx"> created in this resource.
</span><span class="cx"> """
</span><span class="cx"> if self.exists():
</span><del>- self.log.error("Attempt to create collection where file exists: %s" % (self,))
</del><ins>+ self.log.error("Attempt to create collection where file exists: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.NOT_ALLOWED, "File exists"))
</span><span class="cx">
</span><span class="cx"> # newStore guarantees that we always have a parent calendar home
</span><span class="cx"> # if not self.fp.parent().isdir():
</span><del>- # log.error("Attempt to create collection with no parent: %s" % (self.fp.path,))
</del><ins>+ # log.error("Attempt to create collection with no parent: {p}", p=self.fp.path)
</ins><span class="cx"> # raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
</span><span class="cx">
</span><span class="cx"> #
</span><span class="lines">@@ -1410,7 +1410,7 @@
</span><span class="cx"> parent = (yield self._checkParents(request, isPseudoCalendarCollectionResource))
</span><span class="cx">
</span><span class="cx"> if parent is not None:
</span><del>- self.log.error("Cannot create a calendar collection within a calendar collection %s" % (parent,))
</del><ins>+ self.log.error("Cannot create a calendar collection within a calendar collection {p!r}", p=parent)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (caldavxml.caldav_namespace, "calendar-collection-location-ok"),
</span><span class="lines">@@ -1421,7 +1421,7 @@
</span><span class="cx"> if config.MaxCollectionsPerHome:
</span><span class="cx"> parent = (yield self.locateParent(request, request.urlForResource(self)))
</span><span class="cx"> if (yield parent.countOwnedChildren()) >= config.MaxCollectionsPerHome: # NB this ignores shares
</span><del>- self.log.error("Cannot create a calendar collection because there are too many already present in %s" % (parent,))
</del><ins>+ self.log.error("Cannot create a calendar collection because there are too many already present in {p!r}", p=parent)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> customxml.MaxCollections(),
</span><span class="lines">@@ -1484,12 +1484,12 @@
</span><span class="cx"> #
</span><span class="cx">
</span><span class="cx"> if self.exists():
</span><del>- self.log.error("Attempt to create collection where file exists: %s" % (self,))
</del><ins>+ self.log.error("Attempt to create collection where file exists: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.NOT_ALLOWED, "File exists"))
</span><span class="cx">
</span><span class="cx"> # newStore guarantees that we always have a parent calendar home
</span><span class="cx"> # if not os.path.isdir(os.path.dirname(self.fp.path)):
</span><del>- # log.error("Attempt to create collection with no parent: %s" % (self.fp.path,))
</del><ins>+ # log.error("Attempt to create collection with no parent: {p}", p=self.fp.path)
</ins><span class="cx"> # raise HTTPError(StatusResponse(responsecode.CONFLICT, "No parent collection"))
</span><span class="cx">
</span><span class="cx"> #
</span><span class="lines">@@ -1498,7 +1498,7 @@
</span><span class="cx">
</span><span class="cx"> parent = (yield self._checkParents(request, isAddressBookCollectionResource))
</span><span class="cx"> if parent is not None:
</span><del>- self.log.error("Cannot create an address book collection within an address book collection %s" % (parent,))
</del><ins>+ self.log.error("Cannot create an address book collection within an address book collection {p!r}", p=parent)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (carddavxml.carddav_namespace, "addressbook-collection-location-ok"),
</span><span class="lines">@@ -1509,7 +1509,7 @@
</span><span class="cx"> if config.MaxCollectionsPerHome:
</span><span class="cx"> parent = (yield self.locateParent(request, request.urlForResource(self)))
</span><span class="cx"> if (yield parent.countOwnedChildren()) >= config.MaxCollectionsPerHome: # NB this ignores shares
</span><del>- self.log.error("Cannot create a calendar collection because there are too many already present in %s" % (parent,))
</del><ins>+ self.log.error("Cannot create a calendar collection because there are too many already present in {p!r}", p=parent)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> customxml.MaxCollections(),
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavscheduling_storecaldavresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/scheduling_store/caldav/resource.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/scheduling_store/caldav/resource.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/scheduling_store/caldav/resource.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -453,7 +453,7 @@
</span><span class="cx"> contentType = request.headers.getHeader("content-type")
</span><span class="cx"> format = self.determineType(contentType)
</span><span class="cx"> if format is None:
</span><del>- self.log.error("MIME type %s not allowed in calendar collection" % (contentType,))
</del><ins>+ self.log.error("MIME type {t} not allowed in calendar collection", t=contentType)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (caldav_namespace, "supported-calendar-data"),
</span><span class="lines">@@ -465,7 +465,7 @@
</span><span class="cx"> calendar = (yield Component.fromIStream(request.stream, format=format))
</span><span class="cx"> except:
</span><span class="cx"> # FIXME: Bare except
</span><del>- self.log.error("Error while handling POST: %s" % (Failure(),))
</del><ins>+ self.log.error("Error while handling POST: {f}", f=Failure())
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (caldav_namespace, "valid-calendar-data"),
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx"> originator = originatorPrincipal.canonicalCalendarUserAddress()
</span><span class="cx">
</span><span class="cx"> if not originator:
</span><del>- self.log.error("%s request must have Originator" % (self.method,))
</del><ins>+ self.log.error("{m} request must have Originator", m=self.method)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (caldav_namespace, "originator-specified"),
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavsharingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sharing.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sharing.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sharing.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -775,7 +775,7 @@
</span><span class="cx"> try:
</span><span class="cx"> doc = element.WebDAVDocument.fromString(xmldata)
</span><span class="cx"> except ValueError, e:
</span><del>- self.log.error("Error parsing doc (%s) Doc:\n %s" % (str(e), xmldata,))
</del><ins>+ self.log.error("Error parsing doc ({ex}) Doc:\n {x}", ex=str(e), x=xmldata)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (customxml.calendarserver_namespace, "valid-request"),
</span><span class="lines">@@ -787,7 +787,7 @@
</span><span class="cx"> result = (yield self.xmlDocHandlers[type(root)](self, request, root))
</span><span class="cx"> returnValue(result)
</span><span class="cx"> else:
</span><del>- self.log.error("Unsupported XML (%s)" % (root,))
</del><ins>+ self.log.error("Unsupported XML ({r})", r=root)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (customxml.calendarserver_namespace, "valid-request"),
</span><span class="lines">@@ -813,7 +813,7 @@
</span><span class="cx"> if contentType in self._postHandlers:
</span><span class="cx"> return self._postHandlers[contentType](self, request)
</span><span class="cx"> else:
</span><del>- self.log.info("Got a POST on collection or group with an unsupported content type: %s" % (contentType,))
</del><ins>+ self.log.info("Got a POST on collection or group with an unsupported content type: {t}", t=contentType)
</ins><span class="cx"> else:
</span><span class="cx"> self.log.info("Got a POST on collection or group with no content type")
</span><span class="cx"> return succeed(responsecode.FORBIDDEN)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavsqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -124,16 +124,20 @@
</span><span class="cx"> del(self._db_connection)
</span><span class="cx">
</span><span class="cx"> if dbtype != self._db_type():
</span><del>- log.error("Database %s has different type (%s vs. %s)"
- % (db_filename, dbtype, self._db_type()))
</del><ins>+ log.error(
+ "Database {f} has different type ({t1} vs. {t2})",
+ f=db_filename, t1=dbtype, t2=self._db_type(),
+ )
</ins><span class="cx">
</span><span class="cx"> # Delete this index and start over
</span><span class="cx"> os.remove(db_filename)
</span><span class="cx"> return self._db()
</span><span class="cx">
</span><span class="cx"> if version != self._db_version():
</span><del>- log.error("Database %s has different schema (v.%s vs. v.%s)"
- % (db_filename, version, self._db_version()))
</del><ins>+ log.error(
+ "Database {f} has different schema (v.{v1} vs. v.{v2})",
+ f=db_filename, v1=version, v2=self._db_version(),
+ )
</ins><span class="cx">
</span><span class="cx"> # Upgrade the DB
</span><span class="cx"> return self._db_upgrade(version)
</span><span class="lines">@@ -186,7 +190,7 @@
</span><span class="cx"> @param db_filename: the file name of the index database.
</span><span class="cx"> @param q: a database cursor to use.
</span><span class="cx"> """
</span><del>- log.info("Initializing database %s" % (db_filename,))
</del><ins>+ log.info("Initializing database {f}", f=db_filename)
</ins><span class="cx">
</span><span class="cx"> # We need an exclusive lock here as we are making a big change to the database and we don't
</span><span class="cx"> # want other processes to get stomped on or stomp on us.
</span><span class="lines">@@ -363,7 +367,7 @@
</span><span class="cx"> self.lastrowid = q.lastrowid
</span><span class="cx"> return q.fetchall()
</span><span class="cx"> except DatabaseError:
</span><del>- log.error("Exception while executing SQL on DB %s: %r %r" % (self, sql, query_params))
</del><ins>+ log.error("Exception while executing SQL on DB {s!r}: {q!r} {p!r}", s=self, q=sql, p=query_params)
</ins><span class="cx"> raise
</span><span class="cx"> finally:
</span><span class="cx"> q.close()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/stdconfig.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/stdconfig.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/stdconfig.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -28,8 +28,9 @@
</span><span class="cx"> from twext.enterprise.jobs.jobitem import JobItem
</span><span class="cx"> from twext.enterprise.jobs.queue import ControllerQueue
</span><span class="cx"> from twext.enterprise.jobs.workitem import WorkItem
</span><del>-from twext.python.log import Logger, InvalidLogLevelError, LogLevel
</del><ins>+from twext.python.log import Logger
</ins><span class="cx">
</span><ins>+from twisted.logger import InvalidLogLevelError, LogLevel
</ins><span class="cx"> from twisted.python.filepath import FilePath
</span><span class="cx"> from twisted.python.runtime import platform
</span><span class="cx">
</span><span class="lines">@@ -1213,7 +1214,7 @@
</span><span class="cx"> with open(filename) as f:
</span><span class="cx"> configDict = parser.parse(f)
</span><span class="cx"> except (IOError, OSError):
</span><del>- log.error("Configuration file does not exist or is inaccessible: %s" % (filename,))
</del><ins>+ log.error("Configuration file does not exist or is inaccessible: {f}", f=filename)
</ins><span class="cx"> raise ConfigurationError("Configuration file does not exist or is inaccessible: %s" % (filename,))
</span><span class="cx"> else:
</span><span class="cx"> configDict = _cleanup(configDict, self._defaults)
</span><span class="lines">@@ -1416,7 +1417,7 @@
</span><span class="cx">
</span><span class="cx"> for param in items.get("DirectoryService", {}).get("params", {}):
</span><span class="cx"> if dsType in DEFAULT_SERVICE_PARAMS and param not in DEFAULT_SERVICE_PARAMS[dsType]:
</span><del>- log.warn("Parameter %s is not supported by service %s" % (param, dsType))
</del><ins>+ log.warn("Parameter {p} is not supported by service {t}", p=param, t=dsType)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1446,7 +1447,7 @@
</span><span class="cx">
</span><span class="cx"> for param in items.get("ResourceService", {}).get("params", {}):
</span><span class="cx"> if dsType in DEFAULT_RESOURCE_PARAMS and param not in DEFAULT_RESOURCE_PARAMS[dsType]:
</span><del>- log.warn("Parameter %s is not supported by service %s" % (param, dsType))
</del><ins>+ log.warn("Parameter {p} is not supported by service {t}", p=param, t=dsType)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1502,7 +1503,7 @@
</span><span class="cx"> if configDict.AugmentService.type in DEFAULT_AUGMENT_PARAMS:
</span><span class="cx"> for param in tuple(configDict.AugmentService.params):
</span><span class="cx"> if param not in DEFAULT_AUGMENT_PARAMS[configDict.AugmentService.type]:
</span><del>- log.warn("Parameter %s is not supported by service %s" % (param, configDict.AugmentService.type))
</del><ins>+ log.warn("Parameter {p} is not supported by service {t}", p=param, t=configDict.AugmentService.type)
</ins><span class="cx"> del configDict.AugmentService.params[param]
</span><span class="cx">
</span><span class="cx"> # Upgrading augments.xml must be done prior to using the store/directory
</span><span class="lines">@@ -1567,7 +1568,7 @@
</span><span class="cx"> * configDict.AdminACEs
</span><span class="cx"> )
</span><span class="cx">
</span><del>- log.debug("Root ACL: %s" % (configDict.RootResourceACL.toxml(),))
</del><ins>+ log.debug("Root ACL: {x}", x=configDict.RootResourceACL.toxml())
</ins><span class="cx">
</span><span class="cx"> configDict.ProvisioningResourceACL = davxml.ACL(
</span><span class="cx"> # Read-only for anon or authenticated, depending on config
</span><span class="lines">@@ -1588,7 +1589,7 @@
</span><span class="cx"> ]
</span><span class="cx"> )
</span><span class="cx">
</span><del>- log.debug("Nav ACL: %s" % (configDict.ProvisioningResourceACL.toxml(),))
</del><ins>+ log.debug("Nav ACL: {x}", x=configDict.ProvisioningResourceACL.toxml())
</ins><span class="cx">
</span><span class="cx"> def principalObjects(urls):
</span><span class="cx"> for principalURL in urls:
</span><span class="lines">@@ -1628,19 +1629,19 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def _updateLogLevels(configDict, reloading=False):
</span><del>- log.publisher.levels.clearLogLevels()
</del><ins>+ log.levels().clearLogLevels()
</ins><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> if "DefaultLogLevel" in configDict:
</span><span class="cx"> levelName = configDict["DefaultLogLevel"]
</span><span class="cx"> if levelName:
</span><del>- log.publisher.levels.setLogLevelForNamespace(
</del><ins>+ log.levels().setLogLevelForNamespace(
</ins><span class="cx"> None, LogLevel.levelWithName(levelName)
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> if "LogLevels" in configDict:
</span><span class="cx"> for namespace, levelName in configDict["LogLevels"].iteritems():
</span><del>- log.publisher.levels.setLogLevelForNamespace(
</del><ins>+ log.levels().setLogLevelForNamespace(
</ins><span class="cx"> namespace, LogLevel.levelWithName(levelName)
</span><span class="cx"> )
</span><span class="cx">
</span><span class="lines">@@ -1682,7 +1683,7 @@
</span><span class="cx"> topic = getAPNTopicFromCertificate(certPath)
</span><span class="cx"> service[protocol]["Topic"] = topic
</span><span class="cx"> else:
</span><del>- log.error("APNS certificate not found: %s" % (certPath,))
</del><ins>+ log.error("APNS certificate not found: {p}", p=certPath)
</ins><span class="cx"> else:
</span><span class="cx"> log.error("APNS certificate path not specified")
</span><span class="cx">
</span><span class="lines">@@ -1695,13 +1696,13 @@
</span><span class="cx"> try:
</span><span class="cx"> passphrase = getPasswordFromKeychain(accountName)
</span><span class="cx"> service[protocol]["Passphrase"] = passphrase
</span><del>- log.info("%s APNS certificate passphrase retreived from keychain" % (protocol,))
</del><ins>+ log.info("{p} APNS certificate passphrase retreived from keychain", p=protocol)
</ins><span class="cx"> except KeychainAccessError:
</span><span class="cx"> # The system doesn't support keychain
</span><span class="cx"> pass
</span><span class="cx"> except KeychainPasswordNotFound:
</span><span class="cx"> # The password doesn't exist in the keychain.
</span><del>- log.info("%s APNS certificate passphrase not found in keychain" % (protocol,))
</del><ins>+ log.info("{p} APNS certificate passphrase not found in keychain", p=protocol)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1738,13 +1739,13 @@
</span><span class="cx"> if not service[direction]["Password"]:
</span><span class="cx"> password = getPasswordFromKeychain(account)
</span><span class="cx"> service[direction]["Password"] = password
</span><del>- log.info("iMIP %s password successfully retrieved from keychain" % (direction,))
</del><ins>+ log.info("iMIP {d} password successfully retrieved from keychain", d=direction)
</ins><span class="cx"> except KeychainAccessError:
</span><span class="cx"> # The system doesn't support keychain
</span><span class="cx"> pass
</span><span class="cx"> except KeychainPasswordNotFound:
</span><span class="cx"> # The password doesn't exist in the keychain.
</span><del>- log.info("iMIP %s password not found in keychain" % (direction,))
</del><ins>+ log.info("iMIP {d} password not found in keychain", d=direction)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1801,12 +1802,12 @@
</span><span class="cx"> if config_key in os.environ and os.environ[config_key] == config_key_value:
</span><span class="cx"> pass
</span><span class="cx"> else:
</span><del>- log.error("Ignoring unknown configuration option: %r" % (key,))
</del><ins>+ log.error("Ignoring unknown configuration option: {k}", k=key)
</ins><span class="cx"> del cleanDict[key]
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def deprecated(oldKey, newKey):
</span><del>- log.error("Configuration option %r is deprecated in favor of %r." % (oldKey, newKey))
</del><ins>+ log.error("Configuration option {o} is deprecated in favor of {n}.", o=oldKey, n=newKey)
</ins><span class="cx"> if oldKey in configDict and newKey in configDict:
</span><span class="cx"> raise ConfigurationError(
</span><span class="cx"> "Both %r and %r options are specified; use the %r option only."
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavstorebridgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/storebridge.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/storebridge.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/storebridge.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -436,7 +436,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> depth = request.headers.getHeader("depth", "infinity")
</span><span class="lines">@@ -473,13 +473,13 @@
</span><span class="cx">
</span><span class="cx"> # Check sharee collection first
</span><span class="cx"> if self.isShareeResource():
</span><del>- log.debug("Removing shared collection %s" % (self,))
</del><ins>+ log.debug("Removing shared collection {s!r}", s=self)
</ins><span class="cx"> yield self.removeShareeResource(request)
</span><span class="cx"> # Re-initialize to get stuff setup again now we have no object
</span><span class="cx"> self._initializeWithHomeChild(None, self._parentResource)
</span><span class="cx"> returnValue(NO_CONTENT)
</span><span class="cx">
</span><del>- log.debug("Deleting collection %s" % (self,))
</del><ins>+ log.debug("Deleting collection {s!r}", s=self)
</ins><span class="cx">
</span><span class="cx"> # 'deluri' is this resource's URI; I should be able to synthesize it
</span><span class="cx"> # from 'self'.
</span><span class="lines">@@ -536,7 +536,7 @@
</span><span class="cx"> that collections's name.
</span><span class="cx"> """
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> # Can not move outside of home or to existing collection
</span><span class="lines">@@ -2094,7 +2094,7 @@
</span><span class="cx"> raise HTTPError(FORBIDDEN)
</span><span class="cx">
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Unable to store attachment: %s" % (e,))
</del><ins>+ log.error("Unable to store attachment: {ex}", ex=e)
</ins><span class="cx"> raise HTTPError(SERVICE_UNAVAILABLE)
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="lines">@@ -2116,7 +2116,7 @@
</span><span class="cx"> def http_GET(self, request):
</span><span class="cx">
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> stream = ProducerStream()
</span><span class="lines">@@ -2130,7 +2130,7 @@
</span><span class="cx"> try:
</span><span class="cx"> self._newStoreAttachment.retrieve(StreamProtocol())
</span><span class="cx"> except IOError, e:
</span><del>- log.error("Unable to read attachment: %s, due to: %s" % (self, e,))
</del><ins>+ log.error("Unable to read attachment: {s!r}, due to: {ex}", s=self, ex=e)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> headers = {"content-type": self.contentType()}
</span><span class="lines">@@ -2146,7 +2146,7 @@
</span><span class="cx"> raise HTTPError(FORBIDDEN)
</span><span class="cx">
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> yield self._newStoreCalendarObject.removeAttachmentWithName(
</span><span class="lines">@@ -2265,7 +2265,7 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def render(self, request):
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> # Accept header handling
</span><span class="lines">@@ -2368,7 +2368,7 @@
</span><span class="cx"> Override http_DELETE to validate 'depth' header.
</span><span class="cx"> """
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> return self.storeRemove(request)
</span><span class="lines">@@ -2391,7 +2391,7 @@
</span><span class="cx"> # Do some pre-flight checks - must exist, must be move to another
</span><span class="cx"> # CommonHomeChild in the same Home, destination resource must not exist
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> parent = (yield request.locateResource(parentForURL(request.uri)))
</span><span class="lines">@@ -2666,8 +2666,9 @@
</span><span class="cx"> # Do "precondition" test
</span><span class="cx"> if (self.scheduleTag != header):
</span><span class="cx"> log.debug(
</span><del>- "If-Schedule-Tag-Match: header value '%s' does not match resource value '%s'" %
- (header, self.scheduleTag,))
</del><ins>+ "If-Schedule-Tag-Match: header value '{h}' does not match resource value '{r}'",
+ h=header, r=self.scheduleTag
+ )
</ins><span class="cx"> raise HTTPError(PRECONDITION_FAILED)
</span><span class="cx"> return True
</span><span class="cx">
</span><span class="lines">@@ -2907,7 +2908,7 @@
</span><span class="cx"> except Exception as err:
</span><span class="cx">
</span><span class="cx"> if isinstance(err, ValueError):
</span><del>- log.error("Error while handling (calendar) PUT: %s" % (err,))
</del><ins>+ log.error("Error while handling (calendar) PUT: {ex}", ex=err)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, str(err)))
</span><span class="cx"> else:
</span><span class="cx"> raise
</span><span class="lines">@@ -2919,7 +2920,7 @@
</span><span class="cx"> Override http_DELETE to do schedule tag behavior.
</span><span class="cx"> """
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> # Do schedule tag check
</span><span class="lines">@@ -2937,7 +2938,7 @@
</span><span class="cx"> # Do some pre-flight checks - must exist, must be move to another
</span><span class="cx"> # CommonHomeChild in the same Home, destination resource must not exist
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> # Do schedule tag check
</span><span class="lines">@@ -3556,7 +3557,7 @@
</span><span class="cx">
</span><span class="cx"> # Handle sharing
</span><span class="cx"> if self.isShareeResource():
</span><del>- log.debug("Removing shared resource %s" % (self,))
</del><ins>+ log.debug("Removing shared resource {s!r}", s=self)
</ins><span class="cx"> yield self.removeShareeResource(request)
</span><span class="cx"> # Re-initialize to get stuff setup again now we have no object
</span><span class="cx"> self._initializeWithObject(None, self._newStoreParent)
</span><span class="lines">@@ -3672,7 +3673,7 @@
</span><span class="cx"> except Exception as err:
</span><span class="cx">
</span><span class="cx"> if isinstance(err, ValueError):
</span><del>- log.error("Error while handling (vCard) PUT: %s" % (err,))
</del><ins>+ log.error("Error while handling (vCard) PUT: {ex}", ex=err)
</ins><span class="cx"> raise HTTPError(StatusResponse(responsecode.BAD_REQUEST, str(err)))
</span><span class="cx"> else:
</span><span class="cx"> raise
</span><span class="lines">@@ -3717,7 +3718,7 @@
</span><span class="cx"> @rtype: L{davxml.ACL}
</span><span class="cx"> """
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> if not self._parentResource.isShareeResource():
</span><span class="lines">@@ -4044,7 +4045,7 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def http_GET(self, request):
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> returnValue(
</span><span class="lines">@@ -4059,7 +4060,7 @@
</span><span class="cx"> Override http_DELETE to validate 'depth' header.
</span><span class="cx"> """
</span><span class="cx"> if not self.exists():
</span><del>- log.debug("Resource not found: %s" % (self,))
</del><ins>+ log.debug("Resource not found: {s!r}", s=self)
</ins><span class="cx"> raise HTTPError(NOT_FOUND)
</span><span class="cx">
</span><span class="cx"> return self.storeRemove(request)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavtesttest_configpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/test_config.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/test_config.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/test_config.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -17,17 +17,19 @@
</span><span class="cx"> import socket
</span><span class="cx">
</span><span class="cx"> from plistlib import writePlist #@UnresolvedImport
</span><del>-from twext.python.log import LogLevel
-from twext.python.test.test_log import defaultLogLevel, logLevelForNamespace
</del><span class="cx">
</span><ins>+from twext.python.log import Logger
+
</ins><span class="cx"> from twistedcaldav.config import config, ConfigDict, mergeData
</span><span class="cx"> from twistedcaldav.resource import CalDAVResource
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG, PListConfigProvider, \
</span><span class="cx"> RELATIVE_PATHS
</span><span class="cx"> from twistedcaldav.test.util import TestCase
</span><span class="cx">
</span><ins>+from twisted.logger import LogLevel
</ins><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> testConfig = """<?xml version="1.0" encoding="UTF-8"?>
</span><span class="cx"> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
</span><span class="cx"> <plist version="1.0">
</span><span class="lines">@@ -404,6 +406,7 @@
</span><span class="cx"> """
</span><span class="cx"> Logging module configures properly.
</span><span class="cx"> """
</span><ins>+ defaultLogLevel = Logger.filterPredicate.logLevelForNamespace(None)
</ins><span class="cx"> self.assertNotEqual(
</span><span class="cx"> defaultLogLevel, LogLevel.error,
</span><span class="cx"> "This test assumes the default log level is not error."
</span><span class="lines">@@ -412,19 +415,19 @@
</span><span class="cx"> config.setDefaults(DEFAULT_CONFIG)
</span><span class="cx"> config.reload()
</span><span class="cx">
</span><del>- self.assertEquals(logLevelForNamespace(None), defaultLogLevel)
- self.assertEquals(logLevelForNamespace("some.namespace"), defaultLogLevel)
</del><ins>+ self.assertEquals(Logger.filterPredicate.logLevelForNamespace(None), defaultLogLevel)
+ self.assertEquals(Logger.filterPredicate.logLevelForNamespace("some.namespace"), defaultLogLevel)
</ins><span class="cx">
</span><span class="cx"> config.load(self.testConfig)
</span><span class="cx">
</span><del>- self.assertEquals(logLevelForNamespace(None), LogLevel.error)
- self.assertEquals(logLevelForNamespace("some.namespace"), LogLevel.debug)
</del><ins>+ self.assertEquals(Logger.filterPredicate.logLevelForNamespace(None), LogLevel.error)
+ self.assertEquals(Logger.filterPredicate.logLevelForNamespace("some.namespace"), LogLevel.debug)
</ins><span class="cx">
</span><span class="cx"> writePlist({}, self.testConfig)
</span><span class="cx"> config.reload()
</span><span class="cx">
</span><del>- self.assertEquals(logLevelForNamespace(None), defaultLogLevel)
- self.assertEquals(logLevelForNamespace("some.namespace"), defaultLogLevel)
</del><ins>+ self.assertEquals(Logger.filterPredicate.logLevelForNamespace(None), defaultLogLevel)
+ self.assertEquals(Logger.filterPredicate.logLevelForNamespace("some.namespace"), defaultLogLevel)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def test_ConfigDict(self):
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavtestutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/test/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -572,7 +572,7 @@
</span><span class="cx"> # Attempt to exit promptly if a traceback is displayed, so we don't
</span><span class="cx"> # deal with timeouts.
</span><span class="cx"> if "Traceback" in data and not self.terminated:
</span><del>- log.error("Terminating process due to output: %s" % (data,))
</del><ins>+ log.error("Terminating process due to output: {d}", d=data)
</ins><span class="cx"> self.terminated = True
</span><span class="cx"> self.transport.signalProcess("TERM")
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavtimezonespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezones.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezones.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezones.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx"> dbpath.remove()
</span><span class="cx"> TimezoneCache.copyPackage("Updating")
</span><span class="cx"> else:
</span><del>- log.info("Valid timezones at %s" % (dbpath.path,))
</del><ins>+ log.info("Valid timezones at {p}", p=dbpath.path)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @staticmethod
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavtimezonestdservicepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezonestdservice.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezonestdservice.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/timezonestdservice.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -632,7 +632,7 @@
</span><span class="cx"> try:
</span><span class="cx"> vtz = readVTZ(self.aliases[tzid])
</span><span class="cx"> except TimezoneException:
</span><del>- log.error("Failed to find timezone data for alias: %s" % (tzid,))
</del><ins>+ log.error("Failed to find timezone data for alias: {tzid}", tzid=tzid)
</ins><span class="cx"> return None
</span><span class="cx"> else:
</span><span class="cx"> vtz = vtz.duplicate()
</span><span class="lines">@@ -640,7 +640,7 @@
</span><span class="cx"> addVTZ(tzid, vtz)
</span><span class="cx"> calendar.addComponent(vtz.getComponents()[0].duplicate())
</span><span class="cx"> else:
</span><del>- log.error("Failed to find timezone data for: %s" % (tzid,))
</del><ins>+ log.error("Failed to find timezone data for: {tzid}", tzid=tzid)
</ins><span class="cx"> return None
</span><span class="cx">
</span><span class="cx"> return calendar
</span><span class="lines">@@ -700,7 +700,7 @@
</span><span class="cx"> tzdata = f.read()
</span><span class="cx"> md5 = hashlib.md5(tzdata).hexdigest()
</span><span class="cx"> except IOError:
</span><del>- log.error("Unable to read timezone file: %s" % (fullPath,))
</del><ins>+ log.error("Unable to read timezone file: {p}", p=fullPath)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> if checkIfChanged:
</span><span class="lines">@@ -716,7 +716,7 @@
</span><span class="cx"> with open(os.path.join(self.basepath, "links.txt")) as f:
</span><span class="cx"> aliases = f.read()
</span><span class="cx"> except IOError, e:
</span><del>- log.error("Unable to read links.txt file: %s" % (str(e),))
</del><ins>+ log.error("Unable to read links.txt file: {ex}", ex=str(e))
</ins><span class="cx"> aliases = ""
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="lines">@@ -729,9 +729,9 @@
</span><span class="cx"> tzinfo.aliases += (alias_from,)
</span><span class="cx"> self.aliases[alias_from] = alias_to
</span><span class="cx"> else:
</span><del>- log.error("Missing alias from '%s' to '%s'" % (alias_from, alias_to,))
</del><ins>+ log.error("Missing alias from '{fr}' to '{to}'", fr=alias_from, to=alias_to)
</ins><span class="cx"> except ValueError:
</span><del>- log.error("Unable to parse links.txt file: %s" % (str(e),))
</del><ins>+ log.error("Unable to parse links.txt file: {ex}", ex=str(e))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def updateDatabase(self):
</span><span class="lines">@@ -758,7 +758,7 @@
</span><span class="cx"> self.discovered = False
</span><span class="cx"> self._url = None
</span><span class="cx">
</span><del>- log.debug("Configuring secondary server with basepath: %s" % (self.basepath,))
</del><ins>+ log.debug("Configuring secondary server with basepath: {p}", p=self.basepath)
</ins><span class="cx">
</span><span class="cx"> if not os.path.exists(self.basepath):
</span><span class="cx"> os.makedirs(self.basepath)
</span><span class="lines">@@ -799,7 +799,7 @@
</span><span class="cx"> if self.timezones[tzid].dtstamp < newtimezones[tzid].dtstamp:
</span><span class="cx"> changedtzids.add(tzid)
</span><span class="cx">
</span><del>- log.debug("Fetching %d new, %d changed timezones on secondary server" % (len(newtzids), len(changedtzids),))
</del><ins>+ log.debug("Fetching {n} new, {c} changed timezones on secondary server", n=len(newtzids), c=len(changedtzids))
</ins><span class="cx">
</span><span class="cx"> # Now apply changes - do requests in parallel for speedier fetching
</span><span class="cx"> BATCH = 5
</span><span class="lines">@@ -833,17 +833,17 @@
</span><span class="cx"> self.uri = "https://%s/.well-known/timezone" % (self.uri,)
</span><span class="cx">
</span><span class="cx"> testURI = "%s?action=capabilities" % (self.uri,)
</span><del>- log.debug("Discovering secondary server: %s" % (testURI,))
</del><ins>+ log.debug("Discovering secondary server: {uri}", uri=testURI)
</ins><span class="cx"> response = (yield getURL(testURI))
</span><span class="cx"> if response is None or response.code / 100 != 2:
</span><del>- log.error("Unable to discover secondary server: %s" % (testURI,))
</del><ins>+ log.error("Unable to discover secondary server: {uri}", uri=testURI)
</ins><span class="cx"> self.discovered = False
</span><span class="cx"> returnValue(False)
</span><span class="cx">
</span><span class="cx"> # Cache the redirect target
</span><span class="cx"> if hasattr(response, "location"):
</span><span class="cx"> self.uri = response.location
</span><del>- log.debug("Redirected secondary server to: %s" % (self.uri,))
</del><ins>+ log.debug("Redirected secondary server to: {uri}", uri=self.uri)
</ins><span class="cx">
</span><span class="cx"> # TODO: Ignoring the data from capabilities for now
</span><span class="cx">
</span><span class="lines">@@ -867,7 +867,7 @@
</span><span class="cx"> url = "%s?action=list" % (self.uri,)
</span><span class="cx"> if self.dtstamp:
</span><span class="cx"> url = "%s&changedsince=%s" % (url, self.dtstamp,)
</span><del>- log.debug("Getting timezone list from secondary server: %s" % (url,))
</del><ins>+ log.debug("Getting timezone list from secondary server: {url}", url=url)
</ins><span class="cx"> response = (yield getURL(url))
</span><span class="cx"> if response is None or response.code / 100 != 2:
</span><span class="cx"> returnValue(None)
</span><span class="lines">@@ -888,9 +888,9 @@
</span><span class="cx"> aliases = timezone.get("aliases", ())
</span><span class="cx"> timezones[tzid] = TimezoneInfo(tzid, aliases, lastmod, None)
</span><span class="cx"> except (ValueError, KeyError):
</span><del>- log.debug("Failed to parse JSON timezone list response: %s" % (response.data,))
</del><ins>+ log.debug("Failed to parse JSON timezone list response: {resp}", resp=response.data)
</ins><span class="cx"> returnValue(None)
</span><del>- log.debug("Got %s timezones from secondary server" % (len(timezones),))
</del><ins>+ log.debug("Got {len} timezones from secondary server", len=len(timezones))
</ins><span class="cx">
</span><span class="cx"> returnValue((dtstamp, timezones,))
</span><span class="cx">
</span><span class="lines">@@ -899,7 +899,7 @@
</span><span class="cx"> def _getTimezoneFromServer(self, tzinfo):
</span><span class="cx"> # List all from the server
</span><span class="cx"> url = "%s?action=get&tzid=%s" % (self.uri, tzinfo.tzid,)
</span><del>- log.debug("Getting timezone from secondary server: %s" % (url,))
</del><ins>+ log.debug("Getting timezone from secondary server: {url}", url=url)
</ins><span class="cx"> response = (yield getURL(url))
</span><span class="cx"> if response is None or response.code / 100 != 2:
</span><span class="cx"> returnValue(None)
</span><span class="lines">@@ -908,14 +908,14 @@
</span><span class="cx"> ct = ct.split(";", 1)
</span><span class="cx"> ct = ct[0]
</span><span class="cx"> if ct not in ("text/calendar",):
</span><del>- log.error("Invalid content-type '%s' for tzid : %s" % (ct, tzinfo.tzid,))
</del><ins>+ log.error("Invalid content-type '{ct}' for tzid : {tzid}", ct=ct, tzid=tzinfo.tzid)
</ins><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="cx"> ical = response.data
</span><span class="cx"> try:
</span><span class="cx"> calendar = Calendar.parseText(ical)
</span><span class="cx"> except InvalidData:
</span><del>- log.error("Invalid calendar data for tzid: %s" % (tzinfo.tzid,))
</del><ins>+ log.error("Invalid calendar data for tzid: {tzid}", tzid=tzinfo.tzid)
</ins><span class="cx"> returnValue(None)
</span><span class="cx"> ical = calendar.getText()
</span><span class="cx">
</span><span class="lines">@@ -928,7 +928,7 @@
</span><span class="cx"> with open(tzpath, "w") as f:
</span><span class="cx"> f.write(ical)
</span><span class="cx"> except IOError, e:
</span><del>- log.error("Unable to write calendar file for %s: %s" % (tzinfo.tzid, str(e),))
</del><ins>+ log.error("Unable to write calendar file for {tzid}: {ex}", tzid=tzinfo.tzid, ex=str(e))
</ins><span class="cx"> else:
</span><span class="cx"> self.timezones[tzinfo.tzid] = tzinfo
</span><span class="cx">
</span><span class="lines">@@ -939,4 +939,4 @@
</span><span class="cx"> os.remove(tzpath)
</span><span class="cx"> del self.timezones[tzid]
</span><span class="cx"> except IOError, e:
</span><del>- log.error("Unable to write calendar file for %s: %s" % (tzid, str(e),))
</del><ins>+ log.error("Unable to write calendar file for {tzid}: {ex}", tzid=tzid, ex=str(e))
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/upgrade.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/upgrade.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/upgrade.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -93,14 +93,14 @@
</span><span class="cx"> try:
</span><span class="cx"> uid = pwd.getpwnam(config.UserName).pw_uid
</span><span class="cx"> except KeyError:
</span><del>- log.error("User not found: %s" % (config.UserName,))
</del><ins>+ log.error("User not found: {user}", user=config.UserName)
</ins><span class="cx">
</span><span class="cx"> gid = -1
</span><span class="cx"> if config.GroupName:
</span><span class="cx"> try:
</span><span class="cx"> gid = grp.getgrnam(config.GroupName).gr_gid
</span><span class="cx"> except KeyError:
</span><del>- log.error("Group not found: %s" % (config.GroupName,))
</del><ins>+ log.error("Group not found: {grp}", grp=config.GroupName)
</ins><span class="cx">
</span><span class="cx"> return uid, gid
</span><span class="cx">
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> # Skip directories
</span><span class="cx"> continue
</span><span class="cx">
</span><del>- log.debug("Processing: %s" % (resPath,))
</del><ins>+ log.debug("Processing: {path}", path=resPath)
</ins><span class="cx"> needsRewrite = False
</span><span class="cx"> with open(resPath) as res:
</span><span class="cx"> data = res.read()
</span><span class="lines">@@ -151,12 +151,12 @@
</span><span class="cx"> try:
</span><span class="cx"> data, fixed = fixBadQuotes(data)
</span><span class="cx"> if fixed:
</span><del>- log.warn("Fixing bad quotes in %s" % (resPath,))
</del><ins>+ log.warn("Fixing bad quotes in {path}", path=resPath)
</ins><span class="cx"> needsRewrite = True
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.error(
</span><del>- "Error while fixing bad quotes in %s: %s" %
- (resPath, e)
</del><ins>+ "Error while fixing bad quotes in {path}: {ex}",
+ path=resPath, ex=e,
</ins><span class="cx"> )
</span><span class="cx"> errorOccurred = True
</span><span class="cx"> continue
</span><span class="lines">@@ -164,12 +164,12 @@
</span><span class="cx"> try:
</span><span class="cx"> data, fixed = removeIllegalCharacters(data)
</span><span class="cx"> if fixed:
</span><del>- log.warn("Removing illegal characters in %s" % (resPath,))
</del><ins>+ log.warn("Removing illegal characters in {path}", path=resPath)
</ins><span class="cx"> needsRewrite = True
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.error(
</span><del>- "Error while removing illegal characters in %s: %s" %
- (resPath, e)
</del><ins>+ "Error while removing illegal characters in {path}: {ex}",
+ path=resPath, ex=e,
</ins><span class="cx"> )
</span><span class="cx"> errorOccurred = True
</span><span class="cx"> continue
</span><span class="lines">@@ -177,12 +177,12 @@
</span><span class="cx"> try:
</span><span class="cx"> data, fixed = (yield normalizeCUAddrs(data, directory, cuaCache))
</span><span class="cx"> if fixed:
</span><del>- log.debug("Normalized CUAddrs in %s" % (resPath,))
</del><ins>+ log.debug("Normalized CUAddrs in {path}", path=resPath)
</ins><span class="cx"> needsRewrite = True
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.error(
</span><del>- "Error while normalizing %s: %s" %
- (resPath, e)
</del><ins>+ "Error while normalizing {path}: {ex}",
+ path=resPath, ex=e,
</ins><span class="cx"> )
</span><span class="cx"> errorOccurred = True
</span><span class="cx"> continue
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx">
</span><span class="cx"> errorOccurred = False
</span><span class="cx">
</span><del>- log.debug("Upgrading calendar home: %s" % (homePath,))
</del><ins>+ log.debug("Upgrading calendar home: {path}", path=homePath)
</ins><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> for cal in os.listdir(homePath):
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> # Delete the old, now obsolete, notifications directory.
</span><span class="cx"> rmdir(calPath)
</span><span class="cx"> continue
</span><del>- log.debug("Upgrading calendar: %s" % (calPath,))
</del><ins>+ log.debug("Upgrading calendar: {path}", path=calPath)
</ins><span class="cx"> if not (yield upgradeCalendarCollection(calPath, directory, cuaCache)):
</span><span class="cx"> errorOccurred = True
</span><span class="cx">
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx"> except:
</span><span class="cx"> raise
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Failed to upgrade calendar home %s: %s" % (homePath, e))
</del><ins>+ log.error("Failed to upgrade calendar home {path}: {ex}", path=homePath, ex=e)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> returnValue(errorOccurred)
</span><span class="lines">@@ -319,8 +319,8 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> log.debug(
</span><del>- "Moved the calendar user proxy database from '%s' to '%s'."
- % (oldDbPath, newDbPath,)
</del><ins>+ "Moved the calendar user proxy database from '{old}' to '{new}'.",
+ old=oldDbPath, new=newDbPath
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -375,8 +375,8 @@
</span><span class="cx"> # Now delete the on disk representation of principals
</span><span class="cx"> rmdir(oldPrincipals)
</span><span class="cx"> log.debug(
</span><del>- "Removed the old principal directory at '%s'."
- % (oldPrincipals,)
</del><ins>+ "Removed the old principal directory at '{path}'.",
+ path=oldPrincipals,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> calRoot = os.path.join(docRoot, "calendars")
</span><span class="lines">@@ -386,7 +386,7 @@
</span><span class="cx">
</span><span class="cx"> # Move calendar homes to new location:
</span><span class="cx">
</span><del>- log.warn("Moving calendar homes to %s" % (uidHomes,))
</del><ins>+ log.warn("Moving calendar homes to {path}", path=uidHomes)
</ins><span class="cx">
</span><span class="cx"> if os.path.exists(uidHomes):
</span><span class="cx"> for home in os.listdir(uidHomes):
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> os.chown(inboxItemsFile, uid, gid)
</span><span class="cx">
</span><span class="cx"> if total:
</span><del>- log.warn("Processing %d calendar homes in %s" % (total, uidHomes))
</del><ins>+ log.warn("Processing {total} calendar homes in {path}", total=total, path=uidHomes)
</ins><span class="cx">
</span><span class="cx"> # Upgrade calendar homes in the new location:
</span><span class="cx"> count = 0
</span><span class="lines">@@ -495,8 +495,8 @@
</span><span class="cx"> count += 1
</span><span class="cx"> if count % 10 == 0:
</span><span class="cx"> log.warn(
</span><del>- "Processed calendar home %d of %d"
- % (count, total)
</del><ins>+ "Processed calendar home {count} of {total}",
+ count=count, total=total,
</ins><span class="cx"> )
</span><span class="cx"> log.warn("Done processing calendar homes")
</span><span class="cx">
</span><span class="lines">@@ -569,7 +569,7 @@
</span><span class="cx">
</span><span class="cx"> def flattenHome(calHome):
</span><span class="cx">
</span><del>- log.debug("Flattening calendar home: %s" % (calHome,))
</del><ins>+ log.debug("Flattening calendar home: {path}", path=calHome)
</ins><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> for cal in os.listdir(calHome):
</span><span class="lines">@@ -598,19 +598,19 @@
</span><span class="cx"> # newPath = os.path.join(calHome, child)
</span><span class="cx"> # if os.path.exists(newPath):
</span><span class="cx"> # newPath = os.path.join(calHome, str(uuid.uuid4()))
</span><del>-# log.debug("Moving up calendar: %s" % (childCollection,))
</del><ins>+# log.debug("Moving up calendar: {path}", path=childCollection)
</ins><span class="cx"> # os.rename(childCollection, newPath)
</span><span class="cx"> # else:
</span><span class="cx"> # scanCollection(childCollection)
</span><span class="cx">
</span><span class="cx"> if os.path.isdir(calPath):
</span><del>- # log.debug("Regular collection scan: %s" % (calPath,))
</del><ins>+ # log.debug("Regular collection scan: {path}", path=calPath)
</ins><span class="cx"> # scanCollection(calPath)
</span><del>- log.warn("Regular collection hidden: %s" % (calPath,))
</del><ins>+ log.warn("Regular collection hidden: {path}", path=calPath)
</ins><span class="cx"> os.rename(calPath, os.path.join(calHome, ".collection." + os.path.basename(calPath)))
</span><span class="cx">
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Failed to upgrade calendar home %s: %s" % (calHome, e))
</del><ins>+ log.error("Failed to upgrade calendar home {path}: {ex}", path=calHome, ex=e)
</ins><span class="cx"> return succeed(False)
</span><span class="cx">
</span><span class="cx"> return succeed(True)
</span><span class="lines">@@ -780,7 +780,7 @@
</span><span class="cx"> docRoot = config.DocumentRoot
</span><span class="cx">
</span><span class="cx"> if not os.path.exists(docRoot):
</span><del>- log.info("DocumentRoot (%s) doesn't exist; skipping migration" % (docRoot,))
</del><ins>+ log.info("DocumentRoot ({path}) doesn't exist; skipping migration", path=docRoot)
</ins><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> versionFilePath = os.path.join(docRoot, ".calendarserver_version")
</span><span class="lines">@@ -792,22 +792,22 @@
</span><span class="cx"> onDiskVersion = int(versionFile.read().strip())
</span><span class="cx"> except IOError:
</span><span class="cx"> log.error(
</span><del>- "Cannot open %s; skipping migration" %
- (versionFilePath,)
</del><ins>+ "Cannot open {path}; skipping migration",
+ path=versionFilePath,
</ins><span class="cx"> )
</span><span class="cx"> except ValueError:
</span><span class="cx"> log.error(
</span><del>- "Invalid version number in %s; skipping migration" %
- (versionFilePath,)
</del><ins>+ "Invalid version number in {path}; skipping migration",
+ path=versionFilePath,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> uid, gid = getCalendarServerIDs(config)
</span><span class="cx">
</span><span class="cx"> for version, method in upgradeMethods:
</span><span class="cx"> if onDiskVersion < version:
</span><del>- log.warn("Upgrading to version %d" % (version,))
</del><ins>+ log.warn("Upgrading to version {vers}", vers=version)
</ins><span class="cx"> (yield method(config, directory))
</span><del>- log.warn("Upgraded to version %d" % (version,))
</del><ins>+ log.warn("Upgraded to version {vers}", vers=version)
</ins><span class="cx"> with open(versionFilePath, "w") as verFile:
</span><span class="cx"> verFile.write(str(version))
</span><span class="cx"> os.chown(versionFilePath, uid, gid)
</span><span class="lines">@@ -841,7 +841,7 @@
</span><span class="cx"> record = yield directory.recordWithShortName(directory.oldNameToRecordType(recordType), shortName)
</span><span class="cx"> if record is None:
</span><span class="cx"> # We will simply ignore this and not write out an fb-set entry
</span><del>- log.error("Can't update free-busy href; %s is not in the directory" % shortName)
</del><ins>+ log.error("Can't update free-busy href; {user} is not in the directory", user=shortName)
</ins><span class="cx"> returnValue("")
</span><span class="cx">
</span><span class="cx"> uid = record.uid
</span><span class="lines">@@ -1023,7 +1023,7 @@
</span><span class="cx">
</span><span class="cx"> if augmentRecords:
</span><span class="cx"> yield augmentService.addAugmentRecords(augmentRecords)
</span><del>- log.warn("Migrated %d auto-schedule settings" % (len(augmentRecords),))
</del><ins>+ log.warn("Migrated {len} auto-schedule settings", len=len(augmentRecords))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1227,24 +1227,24 @@
</span><span class="cx"> totalItems = len(itemsToProcess)
</span><span class="cx"> ignoreUUIDs = set()
</span><span class="cx"> for ctr, inboxItem in enumerate(itemsToProcess):
</span><del>- log.info("Processing %d/%d inbox item: %s" % (ctr + 1, totalItems, inboxItem,))
</del><ins>+ log.info("Processing {ctr}/{total} inbox item: {item}", ctr=ctr + 1, total=totalItems, item=inboxItem)
</ins><span class="cx"> ignore, uuid, ignore, fileName = inboxItem.rsplit("/", 3)
</span><span class="cx">
</span><span class="cx"> if uuid in ignoreUUIDs:
</span><del>- log.debug("Ignored inbox item - uuid ignored: %s" % (inboxItem,))
</del><ins>+ log.debug("Ignored inbox item - uuid ignored: {item}", item=inboxItem)
</ins><span class="cx"> inboxItems.remove(inboxItem)
</span><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> record = yield directory.recordWithUID(uuid)
</span><span class="cx"> if record is None:
</span><del>- log.debug("Ignored inbox item - no record: %s" % (inboxItem,))
</del><ins>+ log.debug("Ignored inbox item - no record: {item}", item=inboxItem)
</ins><span class="cx"> inboxItems.remove(inboxItem)
</span><span class="cx"> ignoreUUIDs.add(uuid)
</span><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> principal = yield principalCollection.principalForRecord(record)
</span><span class="cx"> if principal is None or not isinstance(principal, DirectoryCalendarPrincipalResource):
</span><del>- log.debug("Ignored inbox item - no principal: %s" % (inboxItem,))
</del><ins>+ log.debug("Ignored inbox item - no principal: {item}", item=inboxItem)
</ins><span class="cx"> inboxItems.remove(inboxItem)
</span><span class="cx"> ignoreUUIDs.add(uuid)
</span><span class="cx"> continue
</span><span class="lines">@@ -1260,7 +1260,7 @@
</span><span class="cx"> try:
</span><span class="cx"> calendarHome = yield principal.calendarHome(request)
</span><span class="cx"> if calendarHome is None:
</span><del>- log.debug("Ignored inbox item - no calendar home: %s" % (inboxItem,))
</del><ins>+ log.debug("Ignored inbox item - no calendar home: {item}", item=inboxItem)
</ins><span class="cx"> inboxItems.remove(inboxItem)
</span><span class="cx"> ignoreUUIDs.add(uuid)
</span><span class="cx"> continue
</span><span class="lines">@@ -1288,13 +1288,13 @@
</span><span class="cx"> )
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.error(
</span><del>- "Error processing inbox item: %s (%s)"
- % (inboxItem, e)
</del><ins>+ "Error processing inbox item: {item} ({ex})",
+ item=inboxItem, ex=e,
</ins><span class="cx"> )
</span><span class="cx"> else:
</span><del>- log.debug("Ignored inbox item - no resource: %s" % (inboxItem,))
</del><ins>+ log.debug("Ignored inbox item - no resource: {item}", item=inboxItem)
</ins><span class="cx"> else:
</span><del>- log.debug("Ignored inbox item - no inbox: %s" % (inboxItem,))
</del><ins>+ log.debug("Ignored inbox item - no inbox: {item}", item=inboxItem)
</ins><span class="cx">
</span><span class="cx"> inboxItems.remove(inboxItem)
</span><span class="cx">
</span><span class="lines">@@ -1305,7 +1305,7 @@
</span><span class="cx"> # FIXME: Some generic exception handlers to deal with unexpected errors that for some reason
</span><span class="cx"> # we are not logging properly.
</span><span class="cx"> except Exception, e:
</span><del>- log.error("Exception during inbox item processing: %s" % (e,))
</del><ins>+ log.error("Exception during inbox item processing: {ex}", ex=e)
</ins><span class="cx">
</span><span class="cx"> except:
</span><span class="cx"> log.error("Unknown exception during inbox item processing.")
</span><span class="lines">@@ -1336,7 +1336,7 @@
</span><span class="cx"> the inbox item.
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug("Processing inbox item %s" % (inboxItem,))
</del><ins>+ log.debug("Processing inbox item {item}", item=inboxItem)
</ins><span class="cx">
</span><span class="cx"> txn = request._newStoreTransaction
</span><span class="cx">
</span><span class="lines">@@ -1351,7 +1351,7 @@
</span><span class="cx"> if calendar.mainType() is not None:
</span><span class="cx"> try:
</span><span class="cx"> method = calendar.propertyValue("METHOD")
</span><del>- log.info("Inbox item method is %s" % (method,))
</del><ins>+ log.info("Inbox item method is {method}", method=method)
</ins><span class="cx"> except ValueError:
</span><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="lines">@@ -1374,7 +1374,7 @@
</span><span class="cx"> internal_request=False, noAttendeeRefresh=True
</span><span class="cx"> )
</span><span class="cx"> else:
</span><del>- log.warn("Removing invalid inbox item: %s" % (uri,))
</del><ins>+ log.warn("Removing invalid inbox item: {uri}", uri=uri)
</ins><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Remove item
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -128,14 +128,14 @@
</span><span class="cx"> try:
</span><span class="cx"> cpuCount = getNCPU()
</span><span class="cx"> except NotImplementedError, e:
</span><del>- log.error("Unable to detect number of CPUs: %s" % (str(e),))
</del><ins>+ log.error("Unable to detect number of CPUs: {ex}", ex=str(e))
</ins><span class="cx"> return minimum
</span><span class="cx">
</span><span class="cx"> if memSize is None:
</span><span class="cx"> try:
</span><span class="cx"> memSize = getMemorySize()
</span><span class="cx"> except NotImplementedError, e:
</span><del>- log.error("Unable to detect amount of installed RAM: %s" % (str(e),))
</del><ins>+ log.error("Unable to detect amount of installed RAM: {ex}", ex=str(e))
</ins><span class="cx"> return minimum
</span><span class="cx">
</span><span class="cx"> countByCore = perCPU * cpuCount
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx">
</span><span class="cx"> self.factory.retried = True
</span><span class="cx">
</span><del>- # self.log.debug("Got a 401 trying to inject [%s]" % (self.headers,))
</del><ins>+ # self.log.debug("Got a 401 trying to inject [{hdrs}]", hdrs=self.headers)
</ins><span class="cx"> details = {}
</span><span class="cx"> basicAvailable = digestAvailable = False
</span><span class="cx"> wwwauth = self.headers.get("www-authenticate")
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtwistedcaldavvcardpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/vcard.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/vcard.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/twistedcaldav/vcard.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -564,17 +564,17 @@
</span><span class="cx"> @raise InvalidVCardDataError: if the given vcard data is not valid.
</span><span class="cx"> """
</span><span class="cx"> if self.name() != "VCARD":
</span><del>- log.debug("Not a vcard: %s" % (self,))
</del><ins>+ log.debug("Not a vcard: {s!r}", s=self)
</ins><span class="cx"> raise InvalidVCardDataError("Not a vcard")
</span><span class="cx">
</span><span class="cx"> # Do underlying vCard library validation with data fix
</span><span class="cx"> fixed, unfixed = self._pycard.validate(doFix=doFix)
</span><span class="cx"> if unfixed:
</span><del>- log.debug("vCard data had unfixable problems:\n %s" % ("\n ".join(unfixed),))
</del><ins>+ log.debug("vCard data had unfixable problems:\n {problems}", problems="\n ".join(unfixed))
</ins><span class="cx"> if doRaise:
</span><span class="cx"> raise InvalidVCardDataError("Address data had unfixable problems:\n %s" % ("\n ".join(unfixed),))
</span><span class="cx"> if fixed:
</span><del>- log.debug("vCard data had fixable problems:\n %s" % ("\n ".join(fixed),))
</del><ins>+ log.debug("vCard data had fixable problems:\n {problems}", problems="\n ".join(fixed))
</ins><span class="cx">
</span><span class="cx"> return fixed, unfixed
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavbasedatastoresubpostgrespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/subpostgres.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/subpostgres.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/subpostgres.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -82,14 +82,14 @@
</span><span class="cx"> def outReceived(self, out):
</span><span class="cx"> for line in out.split("\n"):
</span><span class="cx"> if line:
</span><del>- self.log.info("{message}", message=line)
</del><ins>+ self.log.info("{msg}", msg=line)
</ins><span class="cx"> # self.lineReceiver.dataReceived(out)
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def errReceived(self, err):
</span><span class="cx"> for line in err.split("\n"):
</span><span class="cx"> if line:
</span><del>- self.log.error("{message}", message=line)
</del><ins>+ self.log.error("{msg}", msg=line)
</ins><span class="cx"> self.lineReceiver.dataReceived(err)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavbasedatastoreutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/base/datastore/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -162,8 +162,7 @@
</span><span class="cx"> uu = UUID(normstr)
</span><span class="cx"> except ValueError:
</span><span class="cx"> if isURI:
</span><del>- log.info(format="normalizing urn:uuid: without UUID: %(uid)r",
- uid=somestr)
</del><ins>+ log.info("normalizing urn:uuid: without UUID: {uid!r}", uid=somestr)
</ins><span class="cx"> # not a UUID, whatever
</span><span class="cx"> return somestr
</span><span class="cx"> else:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavbasepropertystoretestbasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/base/propertystore/test/base.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/base/propertystore/test/base.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/base/propertystore/test/base.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -602,6 +602,7 @@
</span><span class="cx">
</span><span class="cx"> self.assertEquals(self.propertyStore.get(name, None), None)
</span><span class="cx"> self.assertEquals(len(self.propertyStore), 0)
</span><ins>+ self.flushLoggedErrors()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/file.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/file.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/file.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -484,10 +484,10 @@
</span><span class="cx"> fixed, unfixed = component.validCalendarData(doFix=True, doRaise=False)
</span><span class="cx">
</span><span class="cx"> if unfixed:
</span><del>- self.log.error("Calendar data at %s had unfixable problems:\n %s" % (self._path.path, "\n ".join(unfixed),))
</del><ins>+ self.log.error("Calendar data at {path} had unfixable problems:\n {problems}", path=self._path.path, problems="\n ".join(unfixed))
</ins><span class="cx">
</span><span class="cx"> if fixed:
</span><del>- self.log.error("Calendar data at %s had fixable problems:\n %s" % (self._path.path, "\n ".join(fixed),))
</del><ins>+ self.log.error("Calendar data at {path} had fixable problems:\n {problems}", path=self._path.path, problems="\n ".join(fixed))
</ins><span class="cx">
</span><span class="cx"> return component
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreindex_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/index_file.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/index_file.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/index_file.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> name_utf8 = name.encode("utf-8")
</span><span class="cx"> if name is not None and self.resource.getChild(name_utf8) is None:
</span><span class="cx"> # Clean up
</span><del>- log.error("Stale resource record found for child %s with UID %s in %s" % (name, uid, self.resource))
</del><ins>+ log.error("Stale resource record found for child {name} with UID {uid} in {rsrc!r}", name=name, uid=uid, resource=self.resource)
</ins><span class="cx"> self._delete_from_db(name, uid, False)
</span><span class="cx"> self._db_commit()
</span><span class="cx"> else:
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx"> names = self.notExpandedBeyond(minDate)
</span><span class="cx"> # Actually expand recurrence max
</span><span class="cx"> for name in names:
</span><del>- self.log.info("Search falls outside range of index for %s %s" % (name, minDate))
</del><ins>+ self.log.info("Search falls outside range of index for {name} {date}", name=name, date=minDate)
</ins><span class="cx"> self.reExpandResource(name, minDate)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -383,8 +383,10 @@
</span><span class="cx"> del row[9]
</span><span class="cx"> results.append(row)
</span><span class="cx"> else:
</span><del>- log.error("Calendar resource %s is missing from %s. Removing from index."
- % (name, self.resource))
</del><ins>+ log.error(
+ "Calendar resource {name} is missing from {rsrc!r}. Removing from index.",
+ name=name, rsrc=self.resource,
+ )
</ins><span class="cx"> self.deleteResource(name)
</span><span class="cx">
</span><span class="cx"> return results
</span><span class="lines">@@ -406,9 +408,10 @@
</span><span class="cx"> if self.resource.getChild(name.encode("utf-8")):
</span><span class="cx"> results.append(row)
</span><span class="cx"> else:
</span><del>- log.error("Calendar resource %s is missing from %s. Removing from index."
- % (name, self.resource))
- self.deleteResource(name)
</del><ins>+ log.error(
+ "Calendar resource {name} is missing from {rsrc!r}. Removing from index.",
+ name=name, rsrc=self.resource,
+ )
</ins><span class="cx">
</span><span class="cx"> return results
</span><span class="cx">
</span><span class="lines">@@ -735,7 +738,7 @@
</span><span class="cx"> instances = calendar.expandTimeRanges(expand, ignoreInvalidInstances=reCreate)
</span><span class="cx"> recurrenceLimit = instances.limit
</span><span class="cx"> except InvalidOverriddenInstanceError, e:
</span><del>- log.error("Invalid instance %s when indexing %s in %s" % (e.rid, name, self.resource,))
</del><ins>+ log.error("Invalid instance {rid} when indexing {name} in {rsrc!r}", rid=e.rid, name=name, rsrc=self.resource)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> # Now coerce indexing to off if needed
</span><span class="lines">@@ -876,9 +879,9 @@
</span><span class="cx">
</span><span class="cx"> def reserveUID(self, uid):
</span><span class="cx"> uid = uid.encode('utf-8')
</span><del>- self.log.debug("Reserving UID %r @ %r" % (
- uid,
- self.index.resource.fp.path)
</del><ins>+ self.log.debug(
+ "Reserving UID {uid} @ {path}",
+ uid=uid, path=self.index.resource.fp.path,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> def _handleFalse(result):
</span><span class="lines">@@ -897,9 +900,9 @@
</span><span class="cx">
</span><span class="cx"> def unreserveUID(self, uid):
</span><span class="cx"> uid = uid.encode('utf-8')
</span><del>- self.log.debug("Unreserving UID %r @ %r" % (
- uid,
- self.index.resource.fp.path)
</del><ins>+ self.log.debug(
+ "Unreserving UID {uid} @ {path}",
+ uid=uid, path=self.index.resource.fp.path,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> def _handleFalse(result):
</span><span class="lines">@@ -916,9 +919,9 @@
</span><span class="cx">
</span><span class="cx"> def isReservedUID(self, uid):
</span><span class="cx"> uid = uid.encode('utf-8')
</span><del>- self.log.debug("Is reserved UID %r @ %r" % (
- uid,
- self.index.resource.fp.path)
</del><ins>+ self.log.debug(
+ "Is reserved UID {uid} @ {path}",
+ uid=uid, path=self.index.resource.fp.path,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> def _checkValue((flags, value)):
</span><span class="lines">@@ -956,7 +959,7 @@
</span><span class="cx"> % (uid, self.index.resource)
</span><span class="cx"> )
</span><span class="cx"> except sqlite.Error, e:
</span><del>- log.error("Unable to reserve UID: %s", (e,))
</del><ins>+ log.error("Unable to reserve UID: {ex}", ex=e)
</ins><span class="cx"> self.index._db_rollback()
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="lines">@@ -980,7 +983,7 @@
</span><span class="cx"> "delete from RESERVED where UID = :1", uid)
</span><span class="cx"> self.index._db_commit()
</span><span class="cx"> except sqlite.Error, e:
</span><del>- log.error("Unable to unreserve UID: %s", (e,))
</del><ins>+ log.error("Unable to unreserve UID: {ex}", ex=e)
</ins><span class="cx"> self.index._db_rollback()
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="lines">@@ -1008,7 +1011,7 @@
</span><span class="cx"> self.index._db_execute("delete from RESERVED where UID = :1", uid)
</span><span class="cx"> self.index._db_commit()
</span><span class="cx"> except sqlite.Error, e:
</span><del>- log.error("Unable to unreserve UID: %s", (e,))
</del><ins>+ log.error("Unable to unreserve UID: {ex}", ex=e)
</ins><span class="cx"> self.index._db_rollback()
</span><span class="cx"> raise
</span><span class="cx"> return False
</span><span class="lines">@@ -1112,7 +1115,7 @@
</span><span class="cx"> try:
</span><span class="cx"> stream = child.open()
</span><span class="cx"> except (IOError, OSError), e:
</span><del>- log.error("Unable to open resource %s: %s" % (name, e))
</del><ins>+ log.error("Unable to open resource {name}: {ex}", name=name, ex=e)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> # FIXME: This is blocking I/O
</span><span class="lines">@@ -1121,9 +1124,9 @@
</span><span class="cx"> calendar.validCalendarData()
</span><span class="cx"> calendar.validCalendarForCalDAV(methodAllowed=False)
</span><span class="cx"> except ValueError:
</span><del>- log.error("Non-calendar resource: %s" % (name,))
</del><ins>+ log.error("Non-calendar resource: {name}", name=name)
</ins><span class="cx"> else:
</span><del>- # og.info("Indexing resource: %s" % (name,))
</del><ins>+ # og.info("Indexing resource: {name}", name=name)
</ins><span class="cx"> self.addResource(name, calendar, True, reCreate=True)
</span><span class="cx"> finally:
</span><span class="cx"> stream.close()
</span><span class="lines">@@ -1227,7 +1230,7 @@
</span><span class="cx"> try:
</span><span class="cx"> stream = child.open()
</span><span class="cx"> except (IOError, OSError), e:
</span><del>- log.error("Unable to open resource %s: %s" % (name, e))
</del><ins>+ log.error("Unable to open resource {name}: {ex}", name=name, ex=e)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> # FIXME: This is blocking I/O
</span><span class="lines">@@ -1236,9 +1239,9 @@
</span><span class="cx"> calendar.validCalendarData()
</span><span class="cx"> calendar.validCalendarForCalDAV(methodAllowed=True)
</span><span class="cx"> except ValueError:
</span><del>- log.error("Non-calendar resource: %s" % (name,))
</del><ins>+ log.error("Non-calendar resource: {name}", name=name)
</ins><span class="cx"> else:
</span><del>- # log.info("Indexing resource: %s" % (name,))
</del><ins>+ # log.info("Indexing resource: {name}", name=name)
</ins><span class="cx"> self.addResource(name, calendar, True, reCreate=True)
</span><span class="cx"> finally:
</span><span class="cx"> stream.close()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastorequeryfilterpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/query/filter.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/query/filter.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/query/filter.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -396,32 +396,32 @@
</span><span class="cx"> if level == 0:
</span><span class="cx"> # Must have VCALENDAR at the top
</span><span class="cx"> if (self.filter_name != "VCALENDAR") or timerange:
</span><del>- log.info("Top-level comp-filter must be VCALENDAR, instead: %s" % (self.filter_name,))
</del><ins>+ log.info("Top-level comp-filter must be VCALENDAR, instead: {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx"> elif level == 1:
</span><span class="cx"> # Disallow VCALENDAR, VALARM, STANDARD, DAYLIGHT, AVAILABLE at the top, everything else is OK
</span><span class="cx"> if self.filter_name in ("VCALENDAR", "VALARM", "STANDARD", "DAYLIGHT", "AVAILABLE"):
</span><del>- log.info("comp-filter wrong component type: %s" % (self.filter_name,))
</del><ins>+ log.info("comp-filter wrong component type: {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> # time-range only on VEVENT, VTODO, VJOURNAL, VFREEBUSY, VAVAILABILITY
</span><span class="cx"> if timerange and self.filter_name not in ("VEVENT", "VTODO", "VJOURNAL", "VFREEBUSY", "VAVAILABILITY"):
</span><del>- log.info("time-range cannot be used with component %s" % (self.filter_name,))
</del><ins>+ log.info("time-range cannot be used with component {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx"> elif level == 2:
</span><span class="cx"> # Disallow VCALENDAR, VTIMEZONE, VEVENT, VTODO, VJOURNAL, VFREEBUSY, VAVAILABILITY at the top, everything else is OK
</span><span class="cx"> if (self.filter_name in ("VCALENDAR", "VTIMEZONE", "VEVENT", "VTODO", "VJOURNAL", "VFREEBUSY", "VAVAILABILITY")):
</span><del>- log.info("comp-filter wrong sub-component type: %s" % (self.filter_name,))
</del><ins>+ log.info("comp-filter wrong sub-component type: {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> # time-range only on VALARM, AVAILABLE
</span><span class="cx"> if timerange and self.filter_name not in ("VALARM", "AVAILABLE",):
</span><del>- log.info("time-range cannot be used with sub-component %s" % (self.filter_name,))
</del><ins>+ log.info("time-range cannot be used with sub-component {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx"> else:
</span><span class="cx"> # Disallow all standard iCal components anywhere else
</span><span class="cx"> if (self.filter_name in ("VCALENDAR", "VTIMEZONE", "VEVENT", "VTODO", "VJOURNAL", "VFREEBUSY", "VALARM", "STANDARD", "DAYLIGHT", "AVAILABLE")) or timerange:
</span><del>- log.info("comp-filter wrong standard component type: %s" % (self.filter_name,))
</del><ins>+ log.info("comp-filter wrong standard component type: {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> # Test each property
</span><span class="lines">@@ -548,7 +548,7 @@
</span><span class="cx">
</span><span class="cx"> # time-range only on COMPLETED, CREATED, DTSTAMP, LAST-MODIFIED
</span><span class="cx"> if timerange and self.filter_name.upper() not in ("COMPLETED", "CREATED", "DTSTAMP", "LAST-MODIFIED"):
</span><del>- log.info("time-range cannot be used with property %s" % (self.filter_name,))
</del><ins>+ log.info("time-range cannot be used with property {name}", name=self.filter_name)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> # Test the time-range
</span><span class="lines">@@ -832,16 +832,16 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> if self.start is not None and self.start.isDateOnly():
</span><del>- log.info("start attribute in <time-range> is not a date-time: %s" % (self.start,))
</del><ins>+ log.info("start attribute in <time-range> is not a date-time: {start}", start=self.start)
</ins><span class="cx"> return False
</span><span class="cx"> if self.end is not None and self.end.isDateOnly():
</span><del>- log.info("end attribute in <time-range> is not a date-time: %s" % (self.end,))
</del><ins>+ log.info("end attribute in <time-range> is not a date-time: {end}", start=self.end)
</ins><span class="cx"> return False
</span><span class="cx"> if self.start is not None and not self.start.utc():
</span><del>- log.info("start attribute in <time-range> is not UTC: %s" % (self.start,))
</del><ins>+ log.info("start attribute in <time-range> is not UTC: {start}", start=self.start)
</ins><span class="cx"> return False
</span><span class="cx"> if self.end is not None and not self.end.utc():
</span><del>- log.info("end attribute in <time-range> is not UTC: %s" % (self.end,))
</del><ins>+ log.info("end attribute in <time-range> is not UTC: {end}", start=self.end)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> # No other tests
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingcaldavdeliverypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/caldav/delivery.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/caldav/delivery.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/caldav/delivery.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -14,10 +14,11 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx">
</span><del>-from twext.python.log import Logger, LogLevel
</del><ins>+from twext.python.log import Logger
</ins><span class="cx"> from txweb2.dav.http import ErrorResponse
</span><span class="cx">
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</span><ins>+from twisted.logger import LogLevel
</ins><span class="cx"> from twisted.python.failure import Failure
</span><span class="cx"> from txweb2 import responsecode
</span><span class="cx"> from txweb2.http import HTTPError
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingfreebusypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/freebusy.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/freebusy.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/freebusy.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -462,7 +462,7 @@
</span><span class="cx"> # between our initial index query and getting here. For now we will ignore this error, but in
</span><span class="cx"> # the longer term we need to implement some form of locking, perhaps.
</span><span class="cx"> if calendar is None:
</span><del>- log.error("Calendar %s is missing from calendar collection %r" % (name, calresource))
</del><ins>+ log.error("Calendar {name} is missing from calendar collection {coll!r}", name=name, coll=calresource)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> if self.accountingItems is not None:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingicaldiffpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/icaldiff.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/icaldiff.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/icaldiff.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -475,7 +475,7 @@
</span><span class="cx">
</span><span class="cx"> result = len(propdiff) == 0
</span><span class="cx"> if not result:
</span><del>- log.debug("VCALENDAR properties differ: %s" % (propdiff,))
</del><ins>+ log.debug("VCALENDAR properties differ: {diff}", diff=propdiff)
</ins><span class="cx"> return result
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -497,7 +497,7 @@
</span><span class="cx">
</span><span class="cx"> # Possible case where one ATTENDEE prop is missing - this happens with a "fake" master sometimes
</span><span class="cx"> if serverAttendee is None or clientAttendee is None:
</span><del>- log.error("ATTENDEE for user making an attendee change is missing: %s" % (self.attendee,))
</del><ins>+ log.error("ATTENDEE for user making an attendee change is missing: {attendee}", attendee=self.attendee)
</ins><span class="cx"> return False, False
</span><span class="cx">
</span><span class="cx"> if serverAttendee.parameterValue("PARTSTAT", "NEEDS-ACTION") != clientAttendee.parameterValue("PARTSTAT", "NEEDS-ACTION"):
</span><span class="lines">@@ -642,13 +642,13 @@
</span><span class="cx"> invalidChanges = []
</span><span class="cx"> propNames = ("DTSTART", "DTEND", "DUE", "RRULE", "RDATE", "EXDATE")
</span><span class="cx"> invalidChanges = [propName for ctr, propName in enumerate(propNames) if serverProps[ctr] != clientProps[ctr]]
</span><del>- log.debug("Critical properties do not match: %s" % (", ".join(invalidChanges),))
</del><ins>+ log.debug("Critical properties do not match: {props}", props=", ".join(invalidChanges))
</ins><span class="cx"> return False
</span><span class="cx"> elif serverProps[-1] != clientProps[-1]:
</span><span class="cx"> # Bad if EXDATEs have been removed
</span><span class="cx"> missing = serverProps[-1] - clientProps[-1]
</span><span class="cx"> if missing:
</span><del>- log.debug("EXDATEs missing: %s" % (", ".join([exdate.getText() for exdate in missing]),))
</del><ins>+ log.debug("EXDATEs missing: {exdates}", exdates=", ".join([exdate.getText() for exdate in missing]))
</ins><span class="cx"> return False
</span><span class="cx"> declines.extend(clientProps[-1] - serverProps[-1])
</span><span class="cx"> return True
</span><span class="lines">@@ -744,7 +744,7 @@
</span><span class="cx">
</span><span class="cx"> # Possible case where ATTENDEE prop is missing - this happens with a "fake" master sometimes
</span><span class="cx"> if attendee is None:
</span><del>- log.error("ATTENDEE for user making an attendee change is missing: %s" % (self.attendee,))
</del><ins>+ log.error("ATTENDEE for user making an attendee change is missing: {attendee}", attendee=self.attendee)
</ins><span class="cx"> return False
</span><span class="cx">
</span><span class="cx"> partstatChanged = attendee.parameterValue("PARTSTAT", "NEEDS-ACTION") != "DECLINED"
</span><span class="lines">@@ -939,7 +939,7 @@
</span><span class="cx"> assert isinstance(comp1, Component) and isinstance(comp2, Component)
</span><span class="cx">
</span><span class="cx"> if comp1.name() != comp2.name():
</span><del>- log.debug("Component names are different: '%s' and '%s'" % (comp1.name(), comp2.name()))
</del><ins>+ log.debug("Component names are different: '{comp1}' and '{comp2}'", comp1=comp1.name(), comp2=comp2.name())
</ins><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> # Duplicate then normalize for comparison
</span><span class="lines">@@ -1031,4 +1031,4 @@
</span><span class="cx"> loggedUID = "Unknown"
</span><span class="cx"> loggedName = accounting.emitAccounting("Implicit Errors", loggedUID, logstr)
</span><span class="cx"> if loggedName:
</span><del>- log.error("Generating Implicit Error accounting at path: %s" % (loggedName,))
</del><ins>+ log.error("Generating Implicit Error accounting at path: {name}", name=loggedName)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingimipinboundpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/inbound.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/inbound.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/inbound.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -21,12 +21,13 @@
</span><span class="cx"> from twext.enterprise.dal.record import fromTable
</span><span class="cx"> from twext.enterprise.jobs.workitem import WorkItem, RegeneratingWorkItem
</span><span class="cx"> from twext.internet.gaiendpoint import GAIEndpoint
</span><del>-from twext.python.log import Logger, LegacyLogger
</del><ins>+from twext.python.log import Logger
</ins><span class="cx">
</span><span class="cx"> from twisted.application import service
</span><span class="cx"> from twisted.internet import protocol, defer, ssl
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</span><span class="cx"> from twisted.mail import pop3client, imap4
</span><ins>+from twisted.python.log import LogPublisher
</ins><span class="cx">
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="cx"> from twistedcaldav.ical import Property, Component
</span><span class="lines">@@ -48,7 +49,7 @@
</span><span class="cx"> # Monkey patch imap4.log so it doesn't emit useless logging,
</span><span class="cx"> # specifically, "Unhandled unsolicited response" nonsense.
</span><span class="cx"> #
</span><del>-class IMAPLogger(LegacyLogger):
</del><ins>+class IMAPLogger(LogPublisher):
</ins><span class="cx"> def msg(self, *message, **kwargs):
</span><span class="cx"> if message and message[0].startswith("Unhandled unsolicited response:"):
</span><span class="cx"> return
</span><span class="lines">@@ -182,7 +183,7 @@
</span><span class="cx"> def scheduleNextMailPoll(store, seconds):
</span><span class="cx"> txn = store.newTransaction(label="scheduleNextMailPoll")
</span><span class="cx"> notBefore = datetime.datetime.utcnow() + datetime.timedelta(seconds=seconds)
</span><del>- log.debug("Scheduling next mail poll: %s" % (notBefore,))
</del><ins>+ log.debug("Scheduling next mail poll: {time}", time=notBefore)
</ins><span class="cx"> yield txn.enqueue(IMIPPollingWork, notBefore=notBefore)
</span><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="lines">@@ -287,7 +288,7 @@
</span><span class="cx"> organizer = calendar.getOrganizer()
</span><span class="cx"> token = self._extractToken(organizer)
</span><span class="cx"> if not token:
</span><del>- log.error("Mail gateway can't find token in DSN %s" % (msgId,))
</del><ins>+ log.error("Mail gateway can't find token in DSN {msgid}", msgid=msgId)
</ins><span class="cx"> return
</span><span class="cx">
</span><span class="cx"> txn = self.store.newTransaction(label="MailReceiver.processDSN")
</span><span class="lines">@@ -299,8 +300,9 @@
</span><span class="cx"> except:
</span><span class="cx"> # This isn't a token we recognize
</span><span class="cx"> log.error(
</span><del>- "Mail gateway found a token (%s) but didn't recognize it in message %s"
- % (token, msgId))
</del><ins>+ "Mail gateway found a token ({token}) but didn't recognize it in message {msgid}",
+ token=token, msgid=msgId,
+ )
</ins><span class="cx"> returnValue(self.UNKNOWN_TOKEN)
</span><span class="cx">
</span><span class="cx"> calendar.removeAllButOneAttendee(record.attendee)
</span><span class="lines">@@ -316,7 +318,7 @@
</span><span class="cx"> # TODO: what to do in this case?
</span><span class="cx"> pass
</span><span class="cx">
</span><del>- log.warn("Mail gateway processing DSN %s" % (msgId,))
</del><ins>+ log.warn("Mail gateway processing DSN {msgid}", msgid=msgId)
</ins><span class="cx"> txn = self.store.newTransaction(label="MailReceiver.processDSN")
</span><span class="cx"> yield txn.enqueue(
</span><span class="cx"> IMIPReplyWork,
</span><span class="lines">@@ -338,12 +340,14 @@
</span><span class="cx"> if not token:
</span><span class="cx"> log.error(
</span><span class="cx"> "Mail gateway didn't find a token in message "
</span><del>- "%s (%s)" % (msg['Message-ID'], msg['To']))
</del><ins>+ "{msgid} ({to})", msgid=msg['Message-ID'], to=msg['To']
+ )
</ins><span class="cx"> returnValue(self.NO_TOKEN)
</span><span class="cx"> else:
</span><span class="cx"> log.error(
</span><del>- "Mail gateway couldn't parse To: address (%s) in "
- "message %s" % (msg['To'], msg['Message-ID']))
</del><ins>+ "Mail gateway couldn't parse To: address ({tp}) in "
+ "message {msgid}", to=msg['To'], msgid=msg['Message-ID']
+ )
</ins><span class="cx"> returnValue(self.MALFORMED_TO_ADDRESS)
</span><span class="cx">
</span><span class="cx"> txn = self.store.newTransaction(label="MailReceiver.processReply")
</span><span class="lines">@@ -355,9 +359,10 @@
</span><span class="cx"> except:
</span><span class="cx"> # This isn't a token we recognize
</span><span class="cx"> log.info(
</span><del>- "Mail gateway found a token (%s) but didn't "
- "recognize it in message %s"
- % (token, msg['Message-ID']))
</del><ins>+ "Mail gateway found a token ({token}) but didn't "
+ "recognize it in message {msgid}",
+ token=token, msgid=msg['Message-ID']
+ )
</ins><span class="cx"> # Any email with an unknown token which was sent over 72 hours ago
</span><span class="cx"> # is deleted. If we can't parse the date we leave it in the inbox.
</span><span class="cx"> dateString = msg.get("Date")
</span><span class="lines">@@ -366,9 +371,8 @@
</span><span class="cx"> dateSent = dateutil.parser.parse(dateString)
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.info(
</span><del>- "Could not parse date in IMIP email '{}' ({})".format(
- dateString, e
- )
</del><ins>+ "Could not parse date in IMIP email '{date}' ({ex})",
+ date=dateString, ex=e,
</ins><span class="cx"> )
</span><span class="cx"> returnValue(self.UNKNOWN_TOKEN)
</span><span class="cx"> now = datetime.datetime.now(dateutil.tz.tzutc())
</span><span class="lines">@@ -384,7 +388,8 @@
</span><span class="cx"> # No icalendar attachment
</span><span class="cx"> log.warn(
</span><span class="cx"> "Mail gateway didn't find an icalendar attachment "
</span><del>- "in message %s" % (msg['Message-ID'],))
</del><ins>+ "in message {msgid}", msgid=msg['Message-ID']
+ )
</ins><span class="cx">
</span><span class="cx"> toAddr = None
</span><span class="cx"> fromAddr = record.attendee[7:]
</span><span class="lines">@@ -401,8 +406,7 @@
</span><span class="cx">
</span><span class="cx"> if toAddr is None:
</span><span class="cx"> log.error(
</span><del>- "Don't have an email address for the organizer; "
- "ignoring reply.")
</del><ins>+ "Don't have an email address for the organizer; ignoring reply.")
</ins><span class="cx"> returnValue(self.NO_ORGANIZER_ADDRESS)
</span><span class="cx">
</span><span class="cx"> settings = config.Scheduling["iMIP"]["Sending"]
</span><span class="lines">@@ -433,8 +437,9 @@
</span><span class="cx"> if organizerProperty is None:
</span><span class="cx"> # ORGANIZER is required per rfc2446 section 3.2.3
</span><span class="cx"> log.warn(
</span><del>- "Mail gateway didn't find an ORGANIZER in REPLY %s"
- % (msg['Message-ID'],))
</del><ins>+ "Mail gateway didn't find an ORGANIZER in REPLY {msgid}",
+ msgid=msg['Message-ID']
+ )
</ins><span class="cx"> event.addProperty(Property("ORGANIZER", record.organizer))
</span><span class="cx"> else:
</span><span class="cx"> organizerProperty.setValue(record.organizer)
</span><span class="lines">@@ -498,8 +503,9 @@
</span><span class="cx"> else:
</span><span class="cx"> # It's a DSN without enough to go on
</span><span class="cx"> log.error(
</span><del>- "Mail gateway can't process DSN %s"
- % (msg['Message-ID'],))
</del><ins>+ "Mail gateway can't process DSN {msgid}",
+ msgid=msg['Message-ID']
+ )
</ins><span class="cx"> return succeed(self.INCOMPLETE_DSN)
</span><span class="cx">
</span><span class="cx"> log.info(
</span><span class="lines">@@ -551,8 +557,9 @@
</span><span class="cx">
</span><span class="cx"> def cbLoginFailed(self, reason):
</span><span class="cx"> self.log.error(
</span><del>- "POP3 login failed for %s" %
- (self.factory.settings["Username"],))
</del><ins>+ "POP3 login failed for {user}",
+ user=self.factory.settings["Username"]
+ )
</ins><span class="cx"> return self.quit()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -571,17 +578,17 @@
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def cbDownloaded(self, lines, id):
</span><del>- self.log.debug("POP downloaded message %d" % (id,))
</del><ins>+ self.log.debug("POP downloaded message {msgid}", msgid=id)
</ins><span class="cx"> actionTaken = (yield self.factory.handleMessage("\r\n".join(lines)))
</span><span class="cx">
</span><span class="cx"> if self.factory.deleteAllMail:
</span><span class="cx"> # Delete all mail we see
</span><del>- self.log.debug("POP deleting message %d" % (id,))
</del><ins>+ self.log.debug("POP deleting message {msgid}", msgid=id)
</ins><span class="cx"> self.delete(id)
</span><span class="cx"> else:
</span><span class="cx"> # Delete only mail we've processed
</span><span class="cx"> if actionTaken == MailReceiver.INJECTION_SUBMITTED:
</span><del>- self.log.debug("POP deleting message %d" % (id,))
</del><ins>+ self.log.debug("POP deleting message {msgid}", msgid=id)
</ins><span class="cx"> self.delete(id)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -695,8 +702,9 @@
</span><span class="cx"> nextUID = self.messageUIDs.pop(0)
</span><span class="cx"> messageListToFetch = imap4.MessageSet(nextUID)
</span><span class="cx"> self.log.debug(
</span><del>- "Downloading message %d of %d (%s)" %
- (self.messageCount - len(self.messageUIDs), self.messageCount, nextUID))
</del><ins>+ "Downloading message {count} of {total} ({next})",
+ count=self.messageCount - len(self.messageUIDs), total=self.messageCount, next=nextUID
+ )
</ins><span class="cx"> self.fetchMessage(messageListToFetch, True).addCallback(
</span><span class="cx"> self.cbGotMessage, messageListToFetch).addErrback(
</span><span class="cx"> self.ebLogError)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingimipoutboundpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/outbound.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/outbound.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/imip/outbound.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -380,15 +380,19 @@
</span><span class="cx">
</span><span class="cx"> if record is None:
</span><span class="cx"> record = (yield txn.imipCreateToken(originator, toAddr.lower(), icaluid))
</span><del>- self.log.debug("Mail gateway created token %s for %s "
- "(originator), %s (recipient) and %s (icaluid)"
- % (record.token, originator, toAddr, icaluid))
</del><ins>+ self.log.debug(
+ "Mail gateway created token {token}for {orig} "
+ "(originator), {recip} (recipient) and {uid} (icaluid)",
+ token=record.token, orig=originator, recip=toAddr, uid=icaluid,
+ )
</ins><span class="cx"> inviteState = "new"
</span><span class="cx">
</span><span class="cx"> else:
</span><del>- self.log.debug("Mail gateway reusing token %s for %s "
- "(originator), %s (recipient) and %s (icaluid)"
- % (record.token, originator, toAddr, icaluid))
</del><ins>+ self.log.debug(
+ "Mail gateway reusing token {token} for {orig} "
+ "(originator), {recip} (recipient) and {uid} (icaluid)",
+ token=record.token, orig=originator, recip=toAddr, uid=icaluid,
+ )
</ins><span class="cx"> inviteState = "update"
</span><span class="cx"> token = record.token
</span><span class="cx">
</span><span class="lines">@@ -489,7 +493,7 @@
</span><span class="cx"> fromAddr, toAddr, msgId, message))
</span><span class="cx"> returnValue(success)
</span><span class="cx"> except Exception, e:
</span><del>- self.log.error("Failed to send IMIP message (%s)" % (str(e),))
</del><ins>+ self.log.error("Failed to send IMIP message ({ex})", ex=str(e))
</ins><span class="cx"> returnValue(False)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -597,8 +601,7 @@
</span><span class="cx"> # always be present (i.e., timezones-by-reference is not allowed in iMIP).
</span><span class="cx"> calendarText = calendar.getTextWithTimezones(includeTimezones=True)
</span><span class="cx">
</span><del>- self.log.debug("Mail gateway sending calendar body: %s"
- % (calendarText,))
</del><ins>+ self.log.debug("Mail gateway sending calendar body: {body}", body=calendarText)
</ins><span class="cx"> msgIcal = MIMEText(calendarText, "calendar", "UTF-8")
</span><span class="cx"> method = calendar.propertyValue("METHOD").lower()
</span><span class="cx"> msgIcal.set_param("method", method)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingimplicitpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/implicit.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/implicit.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/implicit.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -1631,7 +1631,7 @@
</span><span class="cx"> break
</span><span class="cx">
</span><span class="cx"> if found_old:
</span><del>- log.error("valid-attendee-change: Cannot remove ATTENDEE: UID:%s" % (self.uid,))
</del><ins>+ log.error("valid-attendee-change: Cannot remove ATTENDEE: UID: {uid}", uid=self.uid)
</ins><span class="cx"> raise HTTPError(ErrorResponse(
</span><span class="cx"> responsecode.FORBIDDEN,
</span><span class="cx"> (caldav_namespace, "valid-attendee-change"),
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingischeduledkimpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/ischedule/dkim.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/ischedule/dkim.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/ischedule/dkim.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -423,8 +423,8 @@
</span><span class="cx"> dkim_header = "; ".join(["%s=%s" % item for item in dkim_tags])
</span><span class="cx"> self.headers.addRawHeader(DKIM_SIGNATURE, dkim_header)
</span><span class="cx">
</span><del>- log.debug("DKIM: Generated header: DKIM-Signature:%s" % (dkim_header,))
- log.debug("DKIM: Signed headers:\n%s" % (headers,))
</del><ins>+ log.debug("DKIM: Generated header: DKIM-Signature:{hdr}", hdr=dkim_header)
+ log.debug("DKIM: Signed headers:\n{hdrs}", hdrs=headers)
</ins><span class="cx">
</span><span class="cx"> returnValue(signature)
</span><span class="cx">
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx">
</span><span class="cx"> # Extract the set of canonicalized headers being signed
</span><span class="cx"> headers = self.extractSignedHeaders()
</span><del>- log.debug("DKIM: Signed headers:\n%s" % (headers,))
</del><ins>+ log.debug("DKIM: Signed headers:\n{hdrs}", hdrs=headers)
</ins><span class="cx">
</span><span class="cx"> # Locate the public key
</span><span class="cx"> pubkey = (yield self.locatePublicKey())
</span><span class="lines">@@ -577,7 +577,7 @@
</span><span class="cx"> Public key used:
</span><span class="cx"> %s
</span><span class="cx"> """ % (self.headers.getRawHeaders(DKIM_SIGNATURE)[0], headers, pubkey._original_data,)
</span><del>- log.debug("DKIM: %s:%s" % (msg, _debug_msg,))
</del><ins>+ log.debug("DKIM: {msg}:{debug}", msg=msg, debug=_debug_msg)
</ins><span class="cx"> if self._debug:
</span><span class="cx"> msg = "%s:%s" % (msg, _debug_msg,)
</span><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="lines">@@ -595,7 +595,7 @@
</span><span class="cx"> Base64 encoded body:
</span><span class="cx"> %s
</span><span class="cx"> """ % (self.headers.getRawHeaders(DKIM_SIGNATURE), self.hash_method.__name__, base64.b64encode(body),)
</span><del>- log.debug("DKIM: %s:%s" % (msg, _debug_msg,))
</del><ins>+ log.debug("DKIM: {msg}:{debug}", msg=msg, debug=_debug_msg)
</ins><span class="cx"> if self._debug:
</span><span class="cx"> msg = "%s:%s" % (msg, _debug_msg,)
</span><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="lines">@@ -612,16 +612,16 @@
</span><span class="cx"> dkim = self.headers.getRawHeaders(DKIM_SIGNATURE)
</span><span class="cx"> if dkim is None:
</span><span class="cx"> msg = "No DKIM-Signature header present in the request"
</span><del>- log.debug("DKIM: " + msg)
</del><ins>+ log.debug("DKIM: {msg}", msg=msg)
</ins><span class="cx"> raise DKIMMissingError(msg)
</span><span class="cx"> if len(dkim) != 1:
</span><span class="cx"> # TODO: This might need to be changed if we ever support forwarding of iSchedule messages - the forwarder
</span><span class="cx"> # might also sign the message and add its own header
</span><span class="cx"> msg = "Only one DKIM-Signature allowed in the request"
</span><del>- log.debug("DKIM: " + msg)
</del><ins>+ log.debug("DKIM: {msg}", msg=msg)
</ins><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="cx"> dkim = dkim[0]
</span><del>- log.debug("DKIM: Found header: DKIM-Signature:%s" % (dkim,))
</del><ins>+ log.debug("DKIM: Found header: DKIM-Signature:{hdr}", hdr=dkim)
</ins><span class="cx">
</span><span class="cx"> # Extract tags from the header
</span><span class="cx"> self.dkim_tags = DKIMUtils.extractTags(dkim)
</span><span class="lines">@@ -631,7 +631,7 @@
</span><span class="cx"> for tag in required_tags:
</span><span class="cx"> if tag not in self.dkim_tags:
</span><span class="cx"> msg = "Missing DKIM-Signature tag: %s" % (tag,)
</span><del>- log.debug("DKIM: " + msg)
</del><ins>+ log.debug("DKIM: {msg}", msg=msg)
</ins><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="cx">
</span><span class="cx"> check_values = {
</span><span class="lines">@@ -652,7 +652,7 @@
</span><span class="cx"> for item in test:
</span><span class="cx"> if item not in values:
</span><span class="cx"> msg = "Tag: %s has incorrect value: %s" % (tag, self.dkim_tags[tag],)
</span><del>- log.debug("DKIM: " + msg)
</del><ins>+ log.debug("DKIM: {msg}", msg=msg)
</ins><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="cx">
</span><span class="cx"> # Check time stamp
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx"> diff_time = self.time - int(self.dkim_tags["t"])
</span><span class="cx"> if diff_time < -360:
</span><span class="cx"> msg = "Signature time too far in the future: %d seconds" % (diff_time,)
</span><del>- log.debug("DKIM: " + msg)
</del><ins>+ log.debug("DKIM: {msg}", msg=msg)
</ins><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="cx">
</span><span class="cx"> # Check expiration
</span><span class="lines">@@ -668,7 +668,7 @@
</span><span class="cx"> diff_time = self.time - int(self.dkim_tags["x"])
</span><span class="cx"> if diff_time > 0:
</span><span class="cx"> msg = "Signature expired: %d seconds" % (diff_time,)
</span><del>- log.debug("DKIM: " + msg)
</del><ins>+ log.debug("DKIM: {msg}", msg=msg)
</ins><span class="cx"> raise DKIMVerificationError(msg)
</span><span class="cx">
</span><span class="cx"> # Base64 encoded tags might include WSP which we need to ignore
</span><span class="lines">@@ -797,7 +797,7 @@
</span><span class="cx">
</span><span class="cx"> return self._makeKey(pkey)
</span><span class="cx">
</span><del>- log.debug("DKIM: No valid public key: %s %s" % (self._getSelectorKey(), pubkeys,))
</del><ins>+ log.debug("DKIM: No valid public key: {sel} {keys}", sel=self._getSelectorKey(), keys=pubkeys)
</ins><span class="cx"> return None
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -818,7 +818,7 @@
</span><span class="cx"> key._original_data = key_data
</span><span class="cx"> return key
</span><span class="cx"> except:
</span><del>- log.debug("DKIM: Unable to make public key:\n%s" % (key_data,))
</del><ins>+ log.debug("DKIM: Unable to make public key:\n{key}", key=key_data)
</ins><span class="cx"> return None
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -845,9 +845,9 @@
</span><span class="cx"> """
</span><span class="cx"> Do the key lookup using the actual lookup method.
</span><span class="cx"> """
</span><del>- log.debug("DKIM: TXT lookup: %s" % (self._getSelectorKey(),))
</del><ins>+ log.debug("DKIM: TXT lookup: {key}", key=self._getSelectorKey())
</ins><span class="cx"> data = (yield lookupDataViaTXT(self._getSelectorKey()))
</span><del>- log.debug("DKIM: TXT lookup results: %s\n%s" % (self._getSelectorKey(), "\n".join(data),))
</del><ins>+ log.debug("DKIM: TXT lookup results: {key}\n{data}", key=self._getSelectorKey(), data="\n".join(data))
</ins><span class="cx"> returnValue(tuple([DKIMUtils.extractTags(line) for line in data]))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -875,7 +875,7 @@
</span><span class="cx"> # First we do an SRV lookup for _domainkey to get the public key server host/port
</span><span class="cx"> result = (yield lookupServerViaSRV(self.dkim_tags["d"], service="_domainkey_lookup"))
</span><span class="cx"> if result is None:
</span><del>- log.debug("DKIM: SRV _domainkey failed on: %s trying domain directly" % (self.dkim_tags["d"],))
</del><ins>+ log.debug("DKIM: SRV _domainkey failed on: {tag} trying domain directly", tag=self.dkim_tags["d"])
</ins><span class="cx"> host = self.dkim_tags["d"]
</span><span class="cx"> port = ""
</span><span class="cx"> scheme = "https"
</span><span class="lines">@@ -899,20 +899,20 @@
</span><span class="cx"> # First we do an SRV lookup for _domainkey to get the public key server URI
</span><span class="cx"> uri = (yield self._getURI())
</span><span class="cx">
</span><del>- log.debug("DKIM: HTTP/.well-known lookup: %s" % (uri,))
</del><ins>+ log.debug("DKIM: HTTP/.well-known lookup: {uri}", uri=uri)
</ins><span class="cx"> response = (yield getURL(uri))
</span><span class="cx"> if response is None or response.code / 100 != 2:
</span><del>- log.debug("DKIM: Failed http/well-known lookup: %s %s" % (uri, response,))
</del><ins>+ log.debug("DKIM: Failed http/well-known lookup: {uri} {resp}", uri=uri, resp=response)
</ins><span class="cx"> returnValue(())
</span><span class="cx">
</span><span class="cx"> ct = response.headers.getRawHeaders("content-type", ("bogus/type",))[0]
</span><span class="cx"> ct = ct.split(";", 1)
</span><span class="cx"> ct = ct[0].strip()
</span><span class="cx"> if ct not in ("text/plain",):
</span><del>- log.debug("DKIM: Failed http/well-known lookup: wrong content-type returned %s %s" % (uri, ct,))
</del><ins>+ log.debug("DKIM: Failed http/well-known lookup: wrong content-type returned {uri} {ct}", uri=uri, ct=ct)
</ins><span class="cx"> returnValue(())
</span><span class="cx">
</span><del>- log.debug("DKIM: HTTP/.well-known lookup results: %s\n%s" % (uri, response.data,))
</del><ins>+ log.debug("DKIM: HTTP/.well-known lookup results: {uri}\n{resp}", uri=uri, resp=response.data)
</ins><span class="cx"> returnValue(tuple([DKIMUtils.extractTags(line) for line in response.data.splitlines()]))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -941,19 +941,19 @@
</span><span class="cx"> return succeed(())
</span><span class="cx"> keyfile = os.path.join(PublicKeyLookup_PrivateExchange.directory, self._getSelectorKey())
</span><span class="cx"> if not os.path.exists(keyfile):
</span><del>- log.debug("DKIM: Failed private-exchange lookup: no path %s" % (keyfile,))
</del><ins>+ log.debug("DKIM: Failed private-exchange lookup: no path {path}", path=keyfile)
</ins><span class="cx"> return succeed(())
</span><span class="cx">
</span><span class="cx"> # Now read the data
</span><del>- log.debug("DKIM: Private exchange lookup: %s" % (keyfile,))
</del><ins>+ log.debug("DKIM: Private exchange lookup: {path}", path=keyfile)
</ins><span class="cx"> try:
</span><span class="cx"> with open(keyfile) as f:
</span><span class="cx"> keys = f.read()
</span><span class="cx"> except IOError, e:
</span><del>- log.debug("DKIM: Failed private-exchange lookup: could not read %s %s" % (keyfile, e,))
</del><ins>+ log.debug("DKIM: Failed private-exchange lookup: could not read {path} {ex}", path=keyfile, ex=e)
</ins><span class="cx"> return succeed(())
</span><span class="cx">
</span><del>- log.debug("DKIM: Private exchange lookup results: %s\n%s" % (keyfile, keys))
</del><ins>+ log.debug("DKIM: Private exchange lookup results: {path}\n{keys}", path=keyfile, keys=keys)
</ins><span class="cx"> return succeed(tuple([DKIMUtils.extractTags(line) for line in keys.splitlines()]))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -985,14 +985,14 @@
</span><span class="cx"> with open(pubkeyfile) as f:
</span><span class="cx"> key_data = f.read()
</span><span class="cx"> except IOError, e:
</span><del>- log.error("DKIM: Unable to open the public key file: %s because of %s" % (pubkeyfile, e,))
</del><ins>+ log.error("DKIM: Unable to open the public key file: {path} because of {ex}", path=pubkeyfile, ex=e)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> # Make sure we can parse a valid public key
</span><span class="cx"> try:
</span><span class="cx"> RSA.importKey(key_data)
</span><span class="cx"> except:
</span><del>- log.error("DKIM: Invalid public key file: %s" % (pubkeyfile,))
</del><ins>+ log.error("DKIM: Invalid public key file: {path}", path=pubkeyfile)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> # Make the TXT record
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingitippy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/itip.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/itip.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/itip.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx"> if match_component is not None:
</span><span class="cx"> itip_message.addComponent(match_component)
</span><span class="cx"> else:
</span><del>- log.error("Ignoring instance: %s missing in iTIP REPLY for: %s" % (rid, itip_message.resourceUID()))
</del><ins>+ log.error("Ignoring instance: {rid} missing in iTIP REPLY for: {uid}", rid=rid, uid=itip_message.resourceUID())
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> # Now do all overridden ones (sort by RECURRENCE-ID)
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> if match_component is not None:
</span><span class="cx"> calendar.addComponent(match_component)
</span><span class="cx"> else:
</span><del>- log.error("Ignoring instance: %s in iTIP REPLY for: %s" % (rid, itip_message.resourceUID()))
</del><ins>+ log.error("Ignoring instance: {rid} in iTIP REPLY for: {uid}", rid=rid, uid=itip_message.resourceUID())
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> attendee, partstat, private_comment = iTipProcessing.updateAttendeeDataFromReply(itip_component, match_component)
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx"> elif len_attendees == 1:
</span><span class="cx"> return True, (attendees.pop(), rids)
</span><span class="cx"> else:
</span><del>- log.error("ATTENDEE property in a REPLY must be the same in all components\n%s" % (str(itip_message),))
</del><ins>+ log.error("ATTENDEE property in a REPLY must be the same in all components\n{msg}", msg=str(itip_message))
</ins><span class="cx"> return False, None
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -521,7 +521,7 @@
</span><span class="cx"> # Get attendee in reply_component - there MUST be only one
</span><span class="cx"> attendees = tuple(reply_component.getRecipientProperties())
</span><span class="cx"> if len(attendees) != 1:
</span><del>- log.error("There must be one and only one ATTENDEE property in a REPLY\n%s" % (str(reply_component),))
</del><ins>+ log.error("There must be one and only one ATTENDEE property in a REPLY\n{msg}", msg=str(reply_component))
</ins><span class="cx"> return None, False, False
</span><span class="cx">
</span><span class="cx"> attendee = attendees[0]
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingprocessingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/processing.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/processing.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/processing.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -121,21 +121,21 @@
</span><span class="cx"> # to match that of the organizer assuming we have the organizer's full data available, then
</span><span class="cx"> # we try the processing operation again.
</span><span class="cx"> log.failure("{processor}.doImplicitAttendee()", processor=self)
</span><del>- log.error("ImplicitProcessing - originator '%s' to recipient '%s' with UID: '%s' - exception raised will try to fix: %s" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid, e))
</del><ins>+ log.error("ImplicitProcessing - originator '{orig}' to recipient '{recip}' with UID: '{uid}' - exception raised will try to fix: {ex}", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid, ex=e)
</ins><span class="cx"> result = (yield self.doImplicitAttendeeEventFix(e))
</span><span class="cx"> if result:
</span><del>- log.error("ImplicitProcessing - originator '%s' to recipient '%s' with UID: '%s' - restored organizer's copy" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.error("ImplicitProcessing - originator '{orig}' to recipient '{recip}' with UID: '{uid}' - restored organizer's copy", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> try:
</span><span class="cx"> result = (yield self.doImplicitAttendee())
</span><span class="cx"> except Exception, e:
</span><span class="cx"> log.failure("{processor}.doImplicitAttendee()", processor=self)
</span><del>- log.error("ImplicitProcessing - originator '%s' to recipient '%s' with UID: '%s' - exception raised after fix: %s" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid, e))
</del><ins>+ log.error("ImplicitProcessing - originator '{orig}' to recipient '{recip}' with UID: '{uid}' - exception raised after fix: {ex}", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid, ex=e)
</ins><span class="cx"> raise ImplicitProcessorException("5.1;Service unavailable")
</span><span class="cx"> else:
</span><del>- log.error("ImplicitProcessing - originator '%s' to recipient '%s' with UID: '%s' - could not fix" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.error("ImplicitProcessing - originator '{orig}' to recipient '{recip}' with UID: '{uid}' - could not fix", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> raise ImplicitProcessorException("5.1;Service unavailable")
</span><span class="cx"> else:
</span><del>- log.error("METHOD:%s not supported for implicit scheduling." % (self.method,))
</del><ins>+ log.error("METHOD:{metgod} not supported for implicit scheduling.", method=self.method)
</ins><span class="cx"> raise ImplicitProcessorException("3.14;Unsupported capability")
</span><span class="cx">
</span><span class="cx"> returnValue(result)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx"> # Locate the organizer's copy of the event.
</span><span class="cx"> yield self.getRecipientsCopy()
</span><span class="cx"> if self.recipient_calendar is None or self.recipient_in_trash:
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' ignoring UID: '%s' - organizer has no copy" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' ignoring UID: '{uid}' - organizer has no copy", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> returnValue((True, True, False, None,))
</span><span class="cx">
</span><span class="cx"> # Handle new items differently than existing ones.
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx"> self.recipient_calendar.noInstanceIndexing = True
</span><span class="cx">
</span><span class="cx"> # Update the organizer's copy of the event
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:REPLY, UID: '%s' - updating event" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:REPLY, UID: '{uid}' - updating event", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> self.organizer_calendar_resource = (yield self.writeCalendarResource(None, self.recipient_calendar_resource, self.recipient_calendar))
</span><span class="cx"> self.organizer_uid = self.organizer_calendar_resource.parentCollection().ownerHome().uid()
</span><span class="cx"> self.organizer_calendar_resource_id = self.organizer_calendar_resource.id()
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx"> @param only_attendees: list of attendees to refresh (C{None} - refresh all)
</span><span class="cx"> @type only_attendees: C{tuple}
</span><span class="cx"> """
</span><del>- log.debug("ImplicitProcessing - refreshing UID: '%s', Attendees: %s" % (self.uid, ", ".join(only_attendees) if only_attendees else "all"))
</del><ins>+ log.debug("ImplicitProcessing - refreshing UID: '{uid}', Attendees: {att}", uid=self.uid, att=", ".join(only_attendees) if only_attendees else "all")
</ins><span class="cx"> from txdav.caldav.datastore.scheduling.implicit import ImplicitScheduler
</span><span class="cx"> scheduler = ImplicitScheduler()
</span><span class="cx"> yield scheduler.refreshAllAttendeesExceptSome(
</span><span class="lines">@@ -341,7 +341,7 @@
</span><span class="cx"> # If we get a CANCEL and we don't have a matching resource already stored, simply
</span><span class="cx"> # ignore the CANCEL.
</span><span class="cx"> if self.new_resource and self.method == "CANCEL":
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' ignoring METHOD:CANCEL, UID: '%s' - attendee has no copy" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' ignoring METHOD:CANCEL, UID: '{uid}' - attendee has no copy", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> result = (True, True, False, None)
</span><span class="cx"> else:
</span><span class="cx"> result = (yield self.doImplicitAttendeeUpdate())
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx"> # Additional check - if the existing organizer is missing and the originator
</span><span class="cx"> # is local to the server - then allow the change
</span><span class="cx"> if not (existing_organizer == "" and self.originator.hosted()):
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' ignoring UID: '%s' - organizer has no copy" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' ignoring UID: '{uid}' - organizer has no copy", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> # If the recipient copy is in the trash, just remove it
</span><span class="cx"> if self.recipient_in_trash:
</span><span class="cx"> yield self.deleteCalendarResource(self.recipient_calendar_resource)
</span><span class="lines">@@ -400,7 +400,7 @@
</span><span class="cx"> if self.message.hasProperty("X-CALENDARSERVER-SPLIT-OLDER-UID"):
</span><span class="cx"> if config.Scheduling.Options.Splitting.Enabled:
</span><span class="cx"> # Tell the existing resource to split
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' splitting UID: '%s'" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' splitting UID: '{uid}'", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> split = (yield self.doImplicitAttendeeSplit())
</span><span class="cx"> if split:
</span><span class="cx"> returnValue((True, False, False, None,))
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">
</span><span class="cx"> elif self.message.hasProperty("X-CALENDARSERVER-SPLIT-NEWER-UID"):
</span><span class="cx"> if config.Scheduling.Options.Splitting.Enabled:
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' ignoring UID: '%s' - split already done" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' ignoring UID: '{uid}' - split already done", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> returnValue((True, False, False, None,))
</span><span class="cx"> else:
</span><span class="cx"> self.message.removeProperty("X-CALENDARSERVER-SPLIT-NEWER-UID")
</span><span class="lines">@@ -479,16 +479,16 @@
</span><span class="cx"> # Check if the incoming data has the recipient declined in all instances. In that case we will not create
</span><span class="cx"> # a new resource as chances are the recipient previously deleted the resource and we want to keep it deleted.
</span><span class="cx"> if all_declined:
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:REQUEST, UID: '%s' - ignoring all declined" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:REQUEST, UID: '{uid}' - ignoring all declined", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> returnValue((True, False, False, None,))
</span><span class="cx">
</span><span class="cx"> # Check for default calendar
</span><span class="cx"> default = (yield self.recipient.inbox.viewerHome().defaultCalendar(self.message.mainType()))
</span><span class="cx"> if default is None:
</span><del>- log.error("No default calendar for recipient: '%s'." % (self.recipient.cuaddr,))
</del><ins>+ log.error("No default calendar for recipient: '{recip}'.", recip=self.recipient.cuaddr)
</ins><span class="cx"> raise ImplicitProcessorException(iTIPRequestStatus.NO_USER_SUPPORT)
</span><span class="cx">
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:REQUEST, UID: '%s' - new processed" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:REQUEST, UID: '{uid}' - new processed", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> new_calendar = iTipProcessing.processNewRequest(self.message, self.recipient.cuaddr, creating=True)
</span><span class="cx">
</span><span class="cx"> # Handle auto-reply behavior
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx">
</span><span class="cx"> if send_reply:
</span><span class="cx"> # Track outstanding auto-reply processing
</span><del>- log.debug("ImplicitProcessing - recipient '%s' processing UID: '%s' - auto-reply queued" % (self.recipient.cuaddr, self.uid,))
</del><ins>+ log.debug("ImplicitProcessing - recipient '{recip}' processing UID: '{uid}' - auto-reply queued", recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> yield ScheduleAutoReplyWork.autoReply(self.txn, new_resource, partstat)
</span><span class="cx">
</span><span class="cx"> # Build the schedule-changes XML element
</span><span class="lines">@@ -560,13 +560,13 @@
</span><span class="cx"> new_calendar.noInstanceIndexing = not send_reply
</span><span class="cx">
</span><span class="cx"> # Update the attendee's copy of the event
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:REQUEST, UID: '%s' - updating event" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:REQUEST, UID: '{uid}' - updating event", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx">
</span><span class="cx"> new_resource = (yield self.writeCalendarResource(None, self.recipient_calendar_resource, new_calendar))
</span><span class="cx">
</span><span class="cx"> if send_reply:
</span><span class="cx"> # Track outstanding auto-reply processing
</span><del>- log.debug("ImplicitProcessing - recipient '%s' processing UID: '%s' - auto-reply queued" % (self.recipient.cuaddr, self.uid,))
</del><ins>+ log.debug("ImplicitProcessing - recipient '{recip}' processing UID: '{uid}' - auto-reply queued", recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> yield ScheduleAutoReplyWork.autoReply(self.txn, new_resource, partstat)
</span><span class="cx">
</span><span class="cx"> # Build the schedule-changes XML element
</span><span class="lines">@@ -604,7 +604,7 @@
</span><span class="cx">
</span><span class="cx"> else:
</span><span class="cx"> # Request needs to be ignored
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:REQUEST, UID: '%s' - ignoring" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:REQUEST, UID: '{uid}' - ignoring", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> result = (True, False, False, None,)
</span><span class="cx">
</span><span class="cx"> returnValue(result)
</span><span class="lines">@@ -627,7 +627,7 @@
</span><span class="cx"> # the cancelled meeting.
</span><span class="cx"> if self.recipient_in_trash:
</span><span class="cx"> # Note we should never get here as this test is
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' ignoring METHOD:CANCEL, UID: '%s' - attendee copy in trash" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' ignoring METHOD:CANCEL, UID: '{uid}' - attendee copy in trash", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> yield self.deleteCalendarResource(self.recipient_calendar_resource)
</span><span class="cx"> result = (True, True, False, None)
</span><span class="cx"> else:
</span><span class="lines">@@ -658,7 +658,7 @@
</span><span class="cx"> if delete_original:
</span><span class="cx">
</span><span class="cx"> # Delete the attendee's copy of the event
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:CANCEL, UID: '%s' - deleting entire event" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:CANCEL, UID: '{uid}' - deleting entire event", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> yield self.deleteCalendarResource(self.recipient_calendar_resource)
</span><span class="cx">
</span><span class="cx"> # Build the schedule-changes XML element
</span><span class="lines">@@ -673,7 +673,7 @@
</span><span class="cx"> else:
</span><span class="cx">
</span><span class="cx"> # Update the attendee's copy of the event
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:CANCEL, UID: '%s' - updating event" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:CANCEL, UID: '{uid}' - updating event", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> yield self.writeCalendarResource(None, self.recipient_calendar_resource, self.recipient_calendar)
</span><span class="cx">
</span><span class="cx"> # Build the schedule-changes XML element
</span><span class="lines">@@ -689,7 +689,7 @@
</span><span class="cx"> )
</span><span class="cx"> result = (True, autoprocessed, store_inbox, changes)
</span><span class="cx"> else:
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:CANCEL, UID: '%s' - ignoring" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:CANCEL, UID: '{uid}' - ignoring", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> result = (True, False, False, None)
</span><span class="cx">
</span><span class="cx"> returnValue(result)
</span><span class="lines">@@ -703,7 +703,7 @@
</span><span class="cx"> """
</span><span class="cx"> # If there is no existing copy, then we must fail
</span><span class="cx"> if self.new_resource:
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:POLLSTATUS, UID: '%s' - attendee has no copy" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:POLLSTATUS, UID: '{uid}' - attendee has no copy", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> returnValue((True, False, False, None,))
</span><span class="cx">
</span><span class="cx"> processed_message = iTipProcessing.processPollStatus(self.message, self.recipient_calendar)
</span><span class="lines">@@ -713,7 +713,7 @@
</span><span class="cx"> processed_message.noInstanceIndexing = True
</span><span class="cx">
</span><span class="cx"> # Update the attendee's copy of the event
</span><del>- log.debug("ImplicitProcessing - originator '%s' to recipient '%s' processing METHOD:POLLSTATUS, UID: '%s' - updating poll" % (self.originator.cuaddr, self.recipient.cuaddr, self.uid))
</del><ins>+ log.debug("ImplicitProcessing - originator '{orig}' to recipient '{recip}' processing METHOD:POLLSTATUS, UID: '{uid}' - updating poll", orig=self.originator.cuaddr, recip=self.recipient.cuaddr, uid=self.uid)
</ins><span class="cx"> yield self.writeCalendarResource(None, self.recipient_calendar_resource, processed_message)
</span><span class="cx">
</span><span class="cx"> returnValue((True, False, False, None,))
</span><span class="lines">@@ -762,8 +762,8 @@
</span><span class="cx"> AutoScheduleMode.acceptIfFreeDeclineIfBusy
</span><span class="cx"> )
</span><span class="cx">
</span><del>- log.debug("ImplicitProcessing - recipient '%s' processing UID: '%s' - checking for auto-reply with mode: %s" % (self.recipient.cuaddr, self.uid, automode.name,))
</del><span class="cx">
</span><ins>+ log.debug("ImplicitProcessing - recipient '{recip}' processing UID: '{uid}' - checking for auto-reply with mode: {mode}", recip=self.recipient.cuaddr, uid=self.uid, mode=automode.name)
</ins><span class="cx"> cuas = self.recipient.record.calendarUserAddresses
</span><span class="cx">
</span><span class="cx"> # First expand current one to get instances (only go 1 year into the future)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingutilspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/utils.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/utils.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/utils.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">
</span><span class="cx"> if len(objectResources) > 1:
</span><span class="cx"> # Delete all but the first one
</span><del>- log.debug("Should only have zero or one scheduling object resource with UID '%s' in calendar home: %s" % (uid, calendar_home,))
</del><ins>+ log.debug("Should only have zero or one scheduling object resource with UID '{uid}' in calendar home: {home!r}", uid=uid, home=calendar_home)
</ins><span class="cx"> for resource in objectResources[1:]:
</span><span class="cx"> yield resource._removeInternal(internal_state=ComponentRemoveState.INTERNAL, useTrash=False)
</span><span class="cx"> objectResources = objectResources[:1]
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreschedulingworkpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/work.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/work.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/scheduling/work.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -698,7 +698,7 @@
</span><span class="cx"> scheduler = CalDAVScheduler(self.transaction, home.uid())
</span><span class="cx">
</span><span class="cx"> # Do the PUT processing
</span><del>- log.info("Implicit REPLY - attendee: '%s' to organizer: '%s', UID: '%s'" % (originator, recipient, itipmsg.resourceUID(),))
</del><ins>+ log.info("Implicit REPLY - attendee: '{att}' to organizer: '{org}', UID: '{uid}'", att=originator, org=recipient, uid=itipmsg.resourceUID())
</ins><span class="cx"> response = (yield scheduler.doSchedulingViaPUT(originator, (recipient,), itipmsg, internal_request=True))
</span><span class="cx"> returnValue(response)
</span><span class="cx">
</span><span class="lines">@@ -1095,15 +1095,15 @@
</span><span class="cx"> yield NamedLock.acquire(self.transaction, "ImplicitUIDLock:%s" % (hashlib.md5(resource.uid()).hexdigest(),))
</span><span class="cx">
</span><span class="cx"> # Send out a reply
</span><del>- log.debug("ImplicitProcessing - recipient '%s' processing UID: '%s' - auto-reply: %s" % (home.uid(), resource.uid(), self.partstat))
</del><ins>+ log.debug("ImplicitProcessing - recipient '{recip}' processing UID: '{uid}' - auto-reply: {partstat}", recip=home.uid(), uid=resource.uid(), partstat=self.partstat)
</ins><span class="cx"> from txdav.caldav.datastore.scheduling.implicit import ImplicitScheduler
</span><span class="cx"> scheduler = ImplicitScheduler()
</span><span class="cx"> yield scheduler.sendAttendeeReply(self.transaction, resource)
</span><span class="cx"> except Exception, e:
</span><del>- log.debug("ImplicitProcessing - auto-reply exception UID: '%s', %s" % (resource.uid(), str(e)))
</del><ins>+ log.debug("ImplicitProcessing - auto-reply exception UID: '{uid}', {ex}", uid=resource.uid(), ex=str(e))
</ins><span class="cx"> raise
</span><span class="cx"> except:
</span><del>- log.debug("ImplicitProcessing - auto-reply bare exception UID: '%s'" % (resource.uid(),))
</del><ins>+ log.debug("ImplicitProcessing - auto-reply bare exception UID: '{uid}'", uid=resource.uid())
</ins><span class="cx"> raise
</span><span class="cx"> else:
</span><span class="cx"> log.debug("ImplicitProcessing - skipping auto-reply of missing ID: '{rid}'", rid=self.resourceID)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -196,9 +196,9 @@
</span><span class="cx"> ).on(txn))
</span><span class="cx"> total = len(rows)
</span><span class="cx"> count = 0
</span><del>- log.warn("{0} dropbox ids to migrate".format(total,))
</del><ins>+ log.warn("{total} dropbox ids to migrate", total=total)
</ins><span class="cx"> except RuntimeError, e:
</span><del>- log.error("Dropbox migration failed when cleaning out dropbox ids: {0}".format(e,))
</del><ins>+ log.error("Dropbox migration failed when cleaning out dropbox ids: {ex}", ex=e)
</ins><span class="cx"> yield txn.abort()
</span><span class="cx"> raise
</span><span class="cx"> else:
</span><span class="lines">@@ -221,9 +221,9 @@
</span><span class="cx"> for dropbox_id in rows:
</span><span class="cx"> (yield self._upgradeDropbox(txn, dropbox_id))
</span><span class="cx"> count += len(rows)
</span><del>- log.warn("{0} of {1} dropbox ids migrated".format(count, total,))
</del><ins>+ log.warn("{count} of {total} dropbox ids migrated", count=count, total=total)
</ins><span class="cx"> except RuntimeError, e:
</span><del>- log.error("Dropbox migration failed for '{0}': {1}".format(dropbox_id, e,))
</del><ins>+ log.error("Dropbox migration failed for '{id}': {ex}", id=dropbox_id, ex=e)
</ins><span class="cx"> yield txn.abort()
</span><span class="cx"> raise
</span><span class="cx"> else:
</span><span class="lines">@@ -243,11 +243,11 @@
</span><span class="cx"> @type dropbox_id: C{str}
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug("Processing dropbox id: {0}".format(dropbox_id,))
</del><ins>+ log.debug("Processing dropbox id: {id}", id=dropbox_id)
</ins><span class="cx">
</span><span class="cx"> # Get all affected calendar objects
</span><span class="cx"> cobjs = (yield self._loadCalendarObjectsForDropboxID(txn, dropbox_id))
</span><del>- log.debug(" {0} affected calendar objects".format(len(cobjs),))
</del><ins>+ log.debug(" {len} affected calendar objects", len=len(cobjs))
</ins><span class="cx">
</span><span class="cx"> # Get names of each matching attachment
</span><span class="cx"> at = Attachment._attachmentSchema
</span><span class="lines">@@ -256,18 +256,18 @@
</span><span class="cx"> From=at,
</span><span class="cx"> Where=at.DROPBOX_ID == dropbox_id,
</span><span class="cx"> ).on(txn))
</span><del>- log.debug(" {0} associated attachment objects".format(len(names),))
</del><ins>+ log.debug(" {len} associated attachment objects", len=len(names))
</ins><span class="cx">
</span><span class="cx"> # For each attachment, update each calendar object
</span><span class="cx"> for name in names:
</span><span class="cx"> name = name[0]
</span><del>- log.debug(" processing attachment object: {0}".format(name,))
</del><ins>+ log.debug(" processing attachment object: {name}", name=name)
</ins><span class="cx"> attachment = (yield DropBoxAttachment.load(txn, dropbox_id, name))
</span><span class="cx">
</span><span class="cx"> # Check for orphans
</span><span class="cx"> if len(cobjs) == 0:
</span><span class="cx"> # Just remove the attachment
</span><del>- log.warn("Orphaned dropbox id removed: {0}".format(attachment._path,))
</del><ins>+ log.warn("Orphaned dropbox id removed: {path}", path=attachment._path)
</ins><span class="cx"> yield attachment.remove()
</span><span class="cx"> continue
</span><span class="cx">
</span><span class="lines">@@ -278,35 +278,35 @@
</span><span class="cx"> if cobj._parentCollection.ownerHome()._resourceID == attachment._ownerHomeID:
</span><span class="cx"> owners.append(cobj)
</span><span class="cx"> cobj_by_UID[cobj.uid()].append(cobj)
</span><del>- log.debug(" {0} owner calendar objects".format(len(owners),))
- log.debug(" {0} UIDs".format(len(cobj_by_UID),))
- log.debug(" {0} total calendar objects".format(sum([len(items) for items in cobj_by_UID.values()]),))
</del><ins>+ log.debug(" {len} owner calendar objects", len=len(owners))
+ log.debug(" {len} UIDs", len=len(cobj_by_UID))
+ log.debug(" {len} total calendar objects", len=sum([len(items) for items in cobj_by_UID.values()]))
</ins><span class="cx">
</span><span class="cx"> if owners:
</span><span class="cx"> # Create the managed attachment without references to calendar objects.
</span><span class="cx"> managed = (yield attachment.convertToManaged())
</span><del>- log.debug(" converted attachment: {0!r}".format(attachment,))
</del><ins>+ log.debug(" converted attachment: {att!r}", att=attachment)
</ins><span class="cx">
</span><span class="cx"> # Do conversion for each owner object
</span><span class="cx"> for owner_obj in owners:
</span><span class="cx">
</span><span class="cx"> # Add a reference to the managed attachment
</span><span class="cx"> mattachment = (yield managed.newReference(owner_obj._resourceID))
</span><del>- log.debug(" added reference for: {0!r}".format(owner_obj,))
</del><ins>+ log.debug(" added reference for: {owner!r}", owner=owner_obj)
</ins><span class="cx">
</span><span class="cx"> # Rewrite calendar data
</span><span class="cx"> for cobj in cobj_by_UID[owner_obj.uid()]:
</span><span class="cx"> (yield cobj.convertAttachments(attachment, mattachment))
</span><del>- log.debug(" re-wrote calendar object: {0!r}".format(cobj,))
</del><ins>+ log.debug(" re-wrote calendar object: {owner!r}", owner=cobj)
</ins><span class="cx"> else:
</span><span class="cx"> # TODO: look for cobjs that were not changed and remove their ATTACH properties.
</span><span class="cx"> # These could happen if the owner object no longer exists.
</span><span class="cx"> # For now just remove the attachment
</span><del>- log.warn("Unowned dropbox id removed: {0}".format(attachment._path,))
</del><ins>+ log.warn("Unowned dropbox id removed: {path}", path=attachment._path)
</ins><span class="cx"> yield attachment.remove()
</span><span class="cx"> continue
</span><span class="cx">
</span><del>- log.debug(" finished dropbox id: {0}".format(dropbox_id,))
</del><ins>+ log.debug(" finished dropbox id: {id}", id=dropbox_id)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -805,7 +805,7 @@
</span><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> # Make sure the loop does not operate on any new calendars created during the loop
</span><del>- self.log.warn("Splitting calendars for user {0}".format(self._ownerUID,))
</del><ins>+ self.log.warn("Splitting calendars for user {uid}", uid=self._ownerUID)
</ins><span class="cx"> calendars = yield self.calendars()
</span><span class="cx"> for calendar in calendars:
</span><span class="cx">
</span><span class="lines">@@ -816,7 +816,7 @@
</span><span class="cx"> if calendar.isTrash():
</span><span class="cx"> continue
</span><span class="cx"> split_count = yield calendar.splitCollectionByComponentTypes()
</span><del>- self.log.warn(" Calendar: '{0}', split into {1}".format(calendar.name(), split_count + 1,))
</del><ins>+ self.log.warn(" Calendar: '{name}', split into {count}", name=calendar.name(), count=split_count + 1)
</ins><span class="cx">
</span><span class="cx"> yield self.ensureDefaultCalendarsExist()
</span><span class="cx">
</span><span class="lines">@@ -1927,7 +1927,7 @@
</span><span class="cx">
</span><span class="cx"> # Actually expand recurrence max
</span><span class="cx"> for name in names:
</span><del>- self.log.info("Search falls outside range of index for {0} {1} to {2}".format(name, minDate, maxDate))
</del><ins>+ self.log.info("Search falls outside range of index for {name} {min} to {max}", name=name, min=minDate, max=maxDate)
</ins><span class="cx"> yield self.reExpandResource(name, minDate, maxDate)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -4016,8 +4016,9 @@
</span><span class="cx"> recurrenceLimit = instances.limit
</span><span class="cx"> recurrenceLowerLimit = instances.lowerLimit
</span><span class="cx"> except InvalidOverriddenInstanceError, e:
</span><del>- self.log.error("Invalid instance {0} when indexing {1} in {2}".format(
- e.rid, self._name, self._calendar,)
</del><ins>+ self.log.error(
+ "Invalid instance {rid} when indexing {name} in {cal!r}",
+ rid=e.rid, name=self._name, cal=self._calendar,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> if txn._migrating:
</span><span class="lines">@@ -4293,16 +4294,14 @@
</span><span class="cx">
</span><span class="cx"> if unfixed:
</span><span class="cx"> self.log.error(
</span><del>- "Calendar data id={0} had unfixable problems:\n {1}".format(
- self._resourceID, "\n ".join(unfixed),
- )
</del><ins>+ "Calendar data id={id} had unfixable problems:\n {problems}",
+ id=self._resourceID, problems="\n ".join(unfixed),
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> if fixed:
</span><span class="cx"> self.log.error(
</span><del>- "Calendar data id={0} had fixable problems:\n {1}".format(
- self._resourceID, "\n ".join(fixed),
- )
</del><ins>+ "Calendar data id={id} had fixable problems:\n {problems}",
+ id=self._resourceID, problems="\n ".join(fixed),
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> # Check for on-demand data upgrade
</span><span class="lines">@@ -4850,7 +4849,7 @@
</span><span class="cx"> t = attachment.store(content_type, filename)
</span><span class="cx"> yield readStream(stream, t.write)
</span><span class="cx"> except Exception, e:
</span><del>- self.log.error("Unable to store attachment: {0}".format(e,))
</del><ins>+ self.log.error("Unable to store attachment: {ex}", ex=e)
</ins><span class="cx"> raise AttachmentStoreFailed
</span><span class="cx"> yield t.loseConnection()
</span><span class="cx">
</span><span class="lines">@@ -4908,7 +4907,7 @@
</span><span class="cx"> # Check that this is a proper update
</span><span class="cx"> oldattachment = (yield self.attachmentWithManagedID(managed_id))
</span><span class="cx"> if oldattachment is None:
</span><del>- self.log.error("Missing managed attachment even though ATTACHMENT_CALENDAR_OBJECT indicates it is present: {0}".format(managed_id,))
</del><ins>+ self.log.error("Missing managed attachment even though ATTACHMENT_CALENDAR_OBJECT indicates it is present: {mid}", mid=managed_id)
</ins><span class="cx"> raise AttachmentStoreFailed
</span><span class="cx">
</span><span class="cx"> # We actually create a brand new attachment object for the update, but with the same managed-id. That way, other resources
</span><span class="lines">@@ -4917,7 +4916,7 @@
</span><span class="cx"> t = attachment.store(content_type, filename)
</span><span class="cx"> yield readStream(stream, t.write)
</span><span class="cx"> except Exception, e:
</span><del>- self.log.error("Unable to store attachment: {0}".format(e,))
</del><ins>+ self.log.error("Unable to store attachment: {ex}", ex=e)
</ins><span class="cx"> raise AttachmentStoreFailed
</span><span class="cx"> yield t.loseConnection()
</span><span class="cx">
</span><span class="lines">@@ -5266,7 +5265,7 @@
</span><span class="cx"> except (ObjectResourceNameAlreadyExistsError, UIDExistsError, UIDExistsElsewhereError):
</span><span class="cx"> raise InvalidSplit("Chosen UID exists elsewhere.")
</span><span class="cx"> except Exception as e:
</span><del>- log.error("Unknown split exception: {}".format(str(e)))
</del><ins>+ log.error("Unknown split exception: {ex}", ex=str(e))
</ins><span class="cx"> raise InvalidSplit("Unknown error.")
</span><span class="cx"> returnValue(olderObject)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoretesttest_implicitpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_implicit.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_implicit.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_implicit.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -1274,3 +1274,5 @@
</span><span class="cx"> cobjs = (yield calendar2.calendarObjects())
</span><span class="cx"> self.assertTrue(len(cobjs) == 0)
</span><span class="cx"> yield self.commit()
</span><ins>+
+ self.flushLoggedErrors(ValueError)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoretesttest_sqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/test/test_sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -1022,7 +1022,9 @@
</span><span class="cx"> yield d1
</span><span class="cx"> yield d2
</span><span class="cx">
</span><ins>+ self.flushLoggedErrors()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_transferSharingDetails(self):
</span><span class="cx"> """
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcaldavdatastoreutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/caldav/datastore/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> try:
</span><span class="cx"> record = yield recordFunction(cuaddr)
</span><span class="cx"> except Exception, e:
</span><del>- log.debug("Lookup of %s failed: %s" % (cuaddr, e))
</del><ins>+ log.debug("Lookup of {cuaddr} failed: {ex}", cuaddr=cuaddr, ex=e)
</ins><span class="cx"> record = None
</span><span class="cx">
</span><span class="cx"> if record is None:
</span><span class="lines">@@ -204,18 +204,21 @@
</span><span class="cx"> try:
</span><span class="cx"> ctype = yield calendarObject.componentType()
</span><span class="cx"> except Exception, e: # Don't stop for any error
</span><del>- log.error(" Failed to migrate calendar object: %s/%s/%s (%s)" % (
- inCalendar.ownerHome().name(),
- inCalendar.name(),
- calendarObject.name(),
- str(e)
- ))
</del><ins>+ log.error(
+ " Failed to migrate calendar object: {home}/{cal}/{rsrc} (ex)",
+ home=inCalendar.ownerHome().name(),
+ cal=inCalendar.name(),
+ rsrc=calendarObject.name(),
+ ex=str(e),
+ )
</ins><span class="cx"> bad_count += 1
</span><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> if ctype not in ("VEVENT", "VTODO"):
</span><del>- log.error("Migration skipping unsupported (%s) calendar object %r"
- % (ctype, calendarObject))
</del><ins>+ log.error(
+ "Migration skipping unsupported ({ctype}) calendar object {obj!r}",
+ ctype=ctype, obj=calendarObject,
+ )
</ins><span class="cx"> continue
</span><span class="cx"> if merge:
</span><span class="cx"> mightConflict = yield outHome.hasCalendarResourceUIDSomewhereElse(
</span><span class="lines">@@ -223,8 +226,8 @@
</span><span class="cx"> )
</span><span class="cx"> if mightConflict is not None:
</span><span class="cx"> log.warn(
</span><del>- "Not migrating object %s/%s/%s due to potential conflict" %
- (outHome.uid(), outCalendar.name(), calendarObject.name())
</del><ins>+ "Not migrating object {home}/{cal}/{rsrc} due to potential conflict",
+ home=outHome.uid(), cal=outCalendar.name(), rsrc=calendarObject.name(),
</ins><span class="cx"> )
</span><span class="cx"> continue
</span><span class="cx"> try:
</span><span class="lines">@@ -264,20 +267,22 @@
</span><span class="cx"> ok_count += 1
</span><span class="cx">
</span><span class="cx"> except InternalDataStoreError:
</span><del>- log.error(" InternalDataStoreError: Failed to migrate calendar object: %s/%s/%s" % (
- inCalendar.ownerHome().name(),
- inCalendar.name(),
- calendarObject.name(),
- ))
</del><ins>+ log.error(
+ " InternalDataStoreError: Failed to migrate calendar object: {home}/{cal}/{rsrc}",
+ home=inCalendar.ownerHome().name(),
+ cal=inCalendar.name(),
+ rsrc=calendarObject.name(),
+ )
</ins><span class="cx"> bad_count += 1
</span><span class="cx">
</span><span class="cx"> except Exception, e:
</span><del>- log.error(" %s: Failed to migrate calendar object: %s/%s/%s" % (
- str(e),
- inCalendar.ownerHome().name(),
- inCalendar.name(),
- calendarObject.name(),
- ))
</del><ins>+ log.error(
+ " {ex}: Failed to migrate calendar object: {home}/{cal}/{rsrc}",
+ ex=str(e),
+ home=inCalendar.ownerHome().name(),
+ cal=inCalendar.name(),
+ rsrc=calendarObject.name(),
+ )
</ins><span class="cx"> bad_count += 1
</span><span class="cx">
</span><span class="cx"> returnValue((ok_count, bad_count,))
</span><span class="lines">@@ -404,7 +409,7 @@
</span><span class="cx"> yield _migrateCalendar(calendar, outCalendar, getComponent, merge=merge)
</span><span class="cx"> except InternalDataStoreError:
</span><span class="cx"> log.error(
</span><del>- " Failed to migrate calendar: %s/%s" % (inHome.name(), name,)
</del><ins>+ " Failed to migrate calendar: {home}/{cal}", home=inHome.name(), cal=name,
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> # No migration for notifications, since they weren't present in earlier
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/file.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/file.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/file.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -239,10 +239,10 @@
</span><span class="cx"> fixed, unfixed = component.validVCardData(doFix=True, doRaise=False)
</span><span class="cx">
</span><span class="cx"> if unfixed:
</span><del>- self.log.error("Address data at %s had unfixable problems:\n %s" % (self._path.path, "\n ".join(unfixed),))
</del><ins>+ self.log.error("Address data at {path} had unfixable problems:\n {problems}", path=self._path.path, problems="\n ".join(unfixed))
</ins><span class="cx">
</span><span class="cx"> if fixed:
</span><del>- self.log.error("Address data at %s had fixable problems:\n %s" % (self._path.path, "\n ".join(fixed),))
</del><ins>+ self.log.error("Address data at {path} had fixable problems:\n {problems}", path=self._path.path, problems="\n ".join(fixed))
</ins><span class="cx">
</span><span class="cx"> return component
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoreindex_filepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/index_file.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/index_file.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/index_file.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -80,10 +80,10 @@
</span><span class="cx">
</span><span class="cx"> def reserveUID(self, uid):
</span><span class="cx"> uid = uid.encode('utf-8')
</span><del>- self.log.debug("Reserving UID %r @ %r" % (
- uid,
- self.index.resource.fp.path
- ))
</del><ins>+ self.log.debug(
+ "Reserving UID {uid} @ {path}",
+ uid=uid, path=self.index.resource.fp.path,
+ )
</ins><span class="cx">
</span><span class="cx"> def _handleFalse(result):
</span><span class="cx"> if result is False:
</span><span class="lines">@@ -101,10 +101,10 @@
</span><span class="cx">
</span><span class="cx"> def unreserveUID(self, uid):
</span><span class="cx"> uid = uid.encode('utf-8')
</span><del>- self.log.debug("Unreserving UID %r @ %r" % (
- uid,
- self.index.resource.fp.path
- ))
</del><ins>+ self.log.debug(
+ "Unreserving UID {uid} @ {path}",
+ uid=uid, path=self.index.resource.fp.path,
+ )
</ins><span class="cx">
</span><span class="cx"> def _handleFalse(result):
</span><span class="cx"> if result is False:
</span><span class="lines">@@ -120,10 +120,10 @@
</span><span class="cx">
</span><span class="cx"> def isReservedUID(self, uid):
</span><span class="cx"> uid = uid.encode('utf-8')
</span><del>- self.log.debug("Is reserved UID %r @ %r" % (
- uid,
- self.index.resource.fp.path
- ))
</del><ins>+ self.log.debug(
+ "Is reserved UID {uid} @ {path}",
+ uid=uid, path=self.index.resource.fp.path,
+ )
</ins><span class="cx">
</span><span class="cx"> def _checkValue((flags, value)):
</span><span class="cx"> if value is None:
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx"> % (uid, self.index.resource)
</span><span class="cx"> )
</span><span class="cx"> except sqlite.Error, e:
</span><del>- log.error("Unable to reserve UID: %s", (e,))
</del><ins>+ log.error("Unable to reserve UID: {ex}", ex=e)
</ins><span class="cx"> self.index._db_rollback()
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> "delete from RESERVED where UID = :1", uid)
</span><span class="cx"> self.index._db_commit()
</span><span class="cx"> except sqlite.Error, e:
</span><del>- log.error("Unable to unreserve UID: %s", (e,))
</del><ins>+ log.error("Unable to unreserve UID: {ex}", ex=e)
</ins><span class="cx"> self.index._db_rollback()
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx"> self.index._db_execute("delete from RESERVED where UID = :1", uid)
</span><span class="cx"> self.index._db_commit()
</span><span class="cx"> except sqlite.Error, e:
</span><del>- log.error("Unable to unreserve UID: %s", (e,))
</del><ins>+ log.error("Unable to unreserve UID: {ex}", ex=e)
</ins><span class="cx"> self.index._db_rollback()
</span><span class="cx"> raise
</span><span class="cx"> return False
</span><span class="lines">@@ -336,7 +336,7 @@
</span><span class="cx"> name_utf8 = name.encode("utf-8")
</span><span class="cx"> if name is not None and self.resource.getChild(name_utf8) is None:
</span><span class="cx"> # Clean up
</span><del>- log.error("Stale resource record found for child %s with UID %s in %s" % (name, uid, self.resource))
</del><ins>+ log.error("Stale resource record found for child {name} with UID {uid} in {rsrc!r}", name=name, uid=uid, rsrc=self.resource)
</ins><span class="cx"> self._delete_from_db(name, uid, False)
</span><span class="cx"> self._db_commit()
</span><span class="cx"> else:
</span><span class="lines">@@ -507,8 +507,10 @@
</span><span class="cx"> if self.resource.getChild(name.encode("utf-8")):
</span><span class="cx"> yield row
</span><span class="cx"> else:
</span><del>- log.error("vCard resource %s is missing from %s. Removing from index."
- % (name, self.resource))
</del><ins>+ log.error(
+ "vCard resource {name} is missing from {rsrc}. Removing from index.",
+ name=name, rsrc=self.resource,
+ )
</ins><span class="cx"> self.deleteResource(name, None)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -527,8 +529,10 @@
</span><span class="cx"> if self.resource.getChild(name.encode("utf-8")):
</span><span class="cx"> yield row
</span><span class="cx"> else:
</span><del>- log.error("AddressBook resource %s is missing from %s. Removing from index."
- % (name, self.resource))
</del><ins>+ log.error(
+ "AddressBook resource {name} is missing from {rsrc}. Removing from index.",
+ name=name, rsrc=self.resource,
+ )
</ins><span class="cx"> self.deleteResource(name)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -644,7 +648,7 @@
</span><span class="cx"> try:
</span><span class="cx"> stream = child.open()
</span><span class="cx"> except (IOError, OSError), e:
</span><del>- log.error("Unable to open resource %s: %s" % (name, e))
</del><ins>+ log.error("Unable to open resource {name}: {ex}", name=name, ex=e)
</ins><span class="cx"> continue
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="lines">@@ -654,9 +658,9 @@
</span><span class="cx"> vcard.validVCardData()
</span><span class="cx"> vcard.validForCardDAV()
</span><span class="cx"> except ValueError:
</span><del>- log.error("Non-addressbook resource: %s" % (name,))
</del><ins>+ log.error("Non-addressbook resource: {name}", name=name)
</ins><span class="cx"> else:
</span><del>- # log.info("Indexing resource: %s" % (name,))
</del><ins>+ # log.info("Indexing resource: {name}", name=name)
</ins><span class="cx"> self.addResource(name, vcard, True)
</span><span class="cx"> finally:
</span><span class="cx"> stream.close()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -2759,10 +2759,10 @@
</span><span class="cx"> fixed, unfixed = component.validVCardData(doFix=True, doRaise=False)
</span><span class="cx">
</span><span class="cx"> if unfixed:
</span><del>- self.log.error("Address data id=%s had unfixable problems:\n %s" % (self._resourceID, "\n ".join(unfixed),))
</del><ins>+ self.log.error("Address data id={id} had unfixable problems:\n {problems}", id=self._resourceID, problems="\n ".join(unfixed))
</ins><span class="cx">
</span><span class="cx"> if fixed:
</span><del>- self.log.error("Address data id=%s had fixable problems:\n %s" % (self._resourceID, "\n ".join(fixed),))
</del><ins>+ self.log.error("Address data id={id} had fixable problems:\n {problems}", id=self._resourceID, problems="\n ".join(fixed))
</ins><span class="cx">
</span><span class="cx"> if self._kind == _ABO_KIND_GROUP:
</span><span class="cx"> assert not component.hasProperty("X-ADDRESSBOOKSERVER-MEMBER"), "database group vCard text contains members %s" % (component,)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoretesttest_sqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/test/test_sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/test/test_sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/test/test_sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -779,7 +779,9 @@
</span><span class="cx"> yield d1
</span><span class="cx"> yield d2
</span><span class="cx">
</span><ins>+ self.flushLoggedErrors()
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def test_resourceLock(self):
</span><span class="cx"> """
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcarddavdatastoreutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/carddav/datastore/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -101,20 +101,22 @@
</span><span class="cx"> ok_count += 1
</span><span class="cx">
</span><span class="cx"> except InternalDataStoreError:
</span><del>- log.error(" InternalDataStoreError: Failed to migrate address book object: %s/%s/%s" % (
- inAddressbook.ownerHome().name(),
- inAddressbook.name(),
- addressbookObject.name(),
- ))
</del><ins>+ log.error(
+ " InternalDataStoreError: Failed to migrate address book object: {home}/{adbk}/{rsrc}",
+ home=inAddressbook.ownerHome().name(),
+ adbk=inAddressbook.name(),
+ rsrc=addressbookObject.name(),
+ )
</ins><span class="cx"> bad_count += 1
</span><span class="cx">
</span><span class="cx"> except Exception, e:
</span><del>- log.error(" %s: Failed to migrate address book object: %s/%s/%s" % (
- str(e),
- inAddressbook.ownerHome().name(),
- inAddressbook.name(),
- addressbookObject.name(),
- ))
</del><ins>+ log.error(
+ " {ex}: Failed to migrate address book object: {home}/{adbk}/{rsrc}",
+ ex=str(e),
+ home=inAddressbook.ownerHome().name(),
+ adbk=inAddressbook.name(),
+ rsrc=addressbookObject.name(),
+ )
</ins><span class="cx"> bad_count += 1
</span><span class="cx">
</span><span class="cx"> returnValue((ok_count, bad_count,))
</span><span class="lines">@@ -134,4 +136,4 @@
</span><span class="cx"> try:
</span><span class="cx"> yield _migrateAddressbook(addressbook, outAddressbook, getComponent)
</span><span class="cx"> except InternalDataStoreError:
</span><del>- log.error(" Failed to migrate address book: %s/%s" % (inHome.name(), name,))
</del><ins>+ log.error(" Failed to migrate address book: {home}/{name}", home=inHome.name(), name=name)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/file.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/file.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/file.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -944,7 +944,7 @@
</span><span class="cx"> old_used = self.quotaUsedBytes()
</span><span class="cx"> new_used = old_used + delta
</span><span class="cx"> if new_used < 0:
</span><del>- self.log.error("Fixing quota adjusted below zero to %s by change amount %s" % (new_used, delta,))
</del><ins>+ self.log.error("Fixing quota adjusted below zero to {used} by change amount {delta}", used=new_used, delta=delta)
</ins><span class="cx"> new_used = 0
</span><span class="cx"> self.properties()[PropertyName.fromElement(TwistedQuotaUsedProperty)] = TwistedQuotaUsedProperty(str(new_used))
</span><span class="cx">
</span><span class="lines">@@ -1132,7 +1132,7 @@
</span><span class="cx"> trash.remove()
</span><span class="cx"> self.properties()._removeResource()
</span><span class="cx"> except Exception, e:
</span><del>- self.log.error("Unable to delete trashed child at %s: %s" % (trash.fp, e))
</del><ins>+ self.log.error("Unable to delete trashed child at {path}: {ex}", path=trash.fp, ex=e)
</ins><span class="cx">
</span><span class="cx"> self._transaction.addOperation(cleanup, "remove child backup %r" % (self._name,))
</span><span class="cx"> def undo():
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastorepoddingmigrationhome_syncpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/podding/migration/home_sync.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/podding/migration/home_sync.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/podding/migration/home_sync.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> except Exception as ex:
</span><span class="cx"> f = Failure()
</span><span class="cx"> yield txn.abort()
</span><del>- log.error("{label} failed: {e}".format(label=label, e=str(ex)))
</del><ins>+ log.error("{label} failed: {e}", label=label, e=str(ex))
</ins><span class="cx"> returnValue(f)
</span><span class="cx"> else:
</span><span class="cx"> yield txn.commit()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -3021,7 +3021,6 @@
</span><span class="cx"> if trash is None:
</span><span class="cx"> if verbose:
</span><span class="cx"> msg = "No trash collection for principal"
</span><del>- print(msg)
</del><span class="cx"> log.info(msg)
</span><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="lines">@@ -3038,14 +3037,12 @@
</span><span class="cx">
</span><span class="cx"> if verbose:
</span><span class="cx"> msg = "Collection \"{}\":".format(displayName.encode("utf-8"))
</span><del>- print(msg)
</del><span class="cx"> log.info(msg)
</span><span class="cx"> for child in children:
</span><span class="cx"> if verbose:
</span><span class="cx"> component = yield child.component()
</span><span class="cx"> summary = component.mainComponent().propertyValue("SUMMARY", "<no title>")
</span><span class="cx"> msg = " Removing \"{}\"...".format(summary)
</span><del>- print(msg)
</del><span class="cx"> log.info(msg)
</span><span class="cx"> yield child.purge(implicitly=False)
</span><span class="cx"> if verbose:
</span><span class="lines">@@ -3059,14 +3056,12 @@
</span><span class="cx"> )
</span><span class="cx"> if verbose:
</span><span class="cx"> msg = "Collection \"{}\":".format(displayName.encode("utf-8"))
</span><del>- print(msg)
</del><span class="cx"> log.info(msg)
</span><span class="cx"> for child in children:
</span><span class="cx"> if verbose:
</span><span class="cx"> component = yield child.component()
</span><span class="cx"> summary = component.mainComponent().propertyValue("SUMMARY", "<no title>")
</span><span class="cx"> msg = " Removing \"{}\"...".format(summary)
</span><del>- print(msg)
</del><span class="cx"> log.info(msg)
</span><span class="cx"> yield child.purge(implicitly=False)
</span><span class="cx"> if verbose:
</span><span class="lines">@@ -3075,7 +3070,6 @@
</span><span class="cx"> if collection.whenTrashed() < endTime:
</span><span class="cx"> if verbose:
</span><span class="cx"> msg = "Removing collection \"{}\"...".format(displayName.encode("utf-8"))
</span><del>- print(msg)
</del><span class="cx"> log.info(msg)
</span><span class="cx"> yield collection.purge()
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoretesttest_sqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/test_sql.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/test_sql.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/test_sql.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx"> try:
</span><span class="cx"> (yield txn.subtransaction(_test, retries=0))[0][0]
</span><span class="cx"> except AllRetriesFailed:
</span><del>- pass
</del><ins>+ self.flushLoggedErrors()
</ins><span class="cx"> else:
</span><span class="cx"> self.fail("AllRetriesFailed not raised")
</span><span class="cx"> self.assertEqual(ctr[0], 1)
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx"> try:
</span><span class="cx"> (yield txn.subtransaction(_test, retries=2))[0][0]
</span><span class="cx"> except AllRetriesFailed:
</span><del>- pass
</del><ins>+ self.flushLoggedErrors()
</ins><span class="cx"> else:
</span><span class="cx"> self.fail("AllRetriesFailed not raised")
</span><span class="cx"> self.assertEqual(ctr[0], 3)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> try:
</span><span class="cx"> result = yield started
</span><span class="cx"> except AllRetriesFailed:
</span><del>- pass
</del><ins>+ self.flushLoggedErrors()
</ins><span class="cx"> else:
</span><span class="cx"> self.fail("AllRetriesFailed not raised, %r returned instead" %
</span><span class="cx"> (result,))
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoretestutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/util.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/util.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/test/util.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -348,7 +348,7 @@
</span><span class="cx"> yield cleanupTxn.execSQL("select {}.nextval from dual".format(sequence.name), [])
</span><span class="cx"> yield cleanupTxn.execSQL("alter sequence {} increment by {}".format(sequence.name, 1), [])
</span><span class="cx"> except:
</span><del>- log.failure("setval sequence '{}' failed", sequence=sequence.name)
</del><ins>+ log.failure("setval sequence '{sequence}' failed", sequence=sequence.name)
</ins><span class="cx"> yield cleanupTxn.execSQL("update CALENDARSERVER set VALUE = '1' where NAME = 'MIN-VALID-REVISION'", [])
</span><span class="cx">
</span><span class="cx"> yield cleanupTxn.commit()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreupgrademigratepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/migrate.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/migrate.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/migrate.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -316,15 +316,12 @@
</span><span class="cx"> """
</span><span class="cx"> migrateFunc, destFunc = homeTypeLookup.get(homeType)
</span><span class="cx"> uid = normalizeUUIDOrNot(fileHome.uid())
</span><del>- self.log.warn("Starting migration transaction %s UID %r" %
- (homeType, uid))
</del><ins>+ self.log.warn("Starting migration transaction {type} UID {uid}", type=homeType, uid=uid)
</ins><span class="cx"> sqlTxn = self.sqlStore.newTransaction(label="UpgradeToDatabaseStep.migrateOneHome")
</span><span class="cx"> homeGetter = destFunc(sqlTxn)
</span><span class="cx"> sqlHome = yield homeGetter(uid, create=False)
</span><span class="cx"> if sqlHome is not None and not self.merge:
</span><del>- self.log.warn(
- "%s home %r already existed not migrating" % (
- homeType, uid))
</del><ins>+ self.log.warn("{ty[e} home {uid} already existed not migrating", type=homeType, uid=uid)
</ins><span class="cx"> yield sqlTxn.abort()
</span><span class="cx"> returnValue(None)
</span><span class="cx"> try:
</span><span class="lines">@@ -395,7 +392,7 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def _upgradeAction(self, fileTxn, fileHome, homeType):
</span><span class="cx"> uid = fileHome.uid()
</span><del>- self.log.warn("Migrating %s UID %r" % (homeType, uid))
</del><ins>+ self.log.warn("Migrating {type} UID {uid}", type=homeType, uid=uid)
</ins><span class="cx"> yield self.migrateOneHome(fileTxn, homeType, fileHome)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -432,6 +429,6 @@
</span><span class="cx"> (doCalendarUpgrade_4_to_5, "Calendar data upgrade from v4 to v5"),
</span><span class="cx"> (doAddressbookUpgrade_1_to_2, "Addressbook data upgrade from v1 to v2"),
</span><span class="cx"> ):
</span><del>- self.log.warn("Migration extra step: {}".format(description))
</del><ins>+ self.log.warn("Migration extra step: {desc}", desc=description)
</ins><span class="cx"> yield upgrade(self.sqlStore)
</span><span class="cx"> self.sqlStore.setUpgrading(False)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreupgradesqlupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/sql/upgrade.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/sql/upgrade.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/upgrade/sql/upgrade.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -126,13 +126,13 @@
</span><span class="cx"> """
</span><span class="cx"> Do a database schema upgrade.
</span><span class="cx"> """
</span><del>- self.log.warn("Beginning database %s check." % (self.versionDescriptor,))
</del><ins>+ self.log.warn("Beginning database {vers} check.", vers=self.versionDescriptor)
</ins><span class="cx">
</span><span class="cx"> # Retrieve information from schema and database
</span><span class="cx"> dialect, required_version, actual_version = yield self.getVersions()
</span><span class="cx">
</span><span class="cx"> if required_version == actual_version:
</span><del>- self.log.warn("%s version check complete: no upgrade needed." % (self.versionDescriptor.capitalize(),))
</del><ins>+ self.log.warn("{vers} version check complete: no upgrade needed.", vers=self.versionDescriptor.capitalize())
</ins><span class="cx"> elif required_version < actual_version:
</span><span class="cx"> msg = "Actual %s version %s is more recent than the expected version %s. The service cannot be started" % (
</span><span class="cx"> self.versionDescriptor, actual_version, required_version,
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> yield self.upgradeVersion(actual_version, required_version, dialect)
</span><span class="cx"> self.sqlStore.setUpgrading(False)
</span><span class="cx">
</span><del>- self.log.warn("Database %s check complete." % (self.versionDescriptor,))
</del><ins>+ self.log.warn("Database {vers} check complete.", vers=self.versionDescriptor)
</ins><span class="cx">
</span><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> raise RuntimeError(msg)
</span><span class="cx"> else:
</span><span class="cx"> required_version = int(found.group(1))
</span><del>- self.log.warn("Required database key %s: %s." % (self.versionKey, required_version,))
</del><ins>+ self.log.warn("Required database key {key}: {vers}.", key=self.versionKey, vers=required_version)
</ins><span class="cx">
</span><span class="cx"> # Get the schema version in the current database
</span><span class="cx"> sqlTxn = self.sqlStore.newTransaction(label="UpgradeDatabaseCoreStep.getVersions")
</span><span class="lines">@@ -178,14 +178,14 @@
</span><span class="cx"> yield sqlTxn.commit()
</span><span class="cx"> except (RuntimeError, ValueError):
</span><span class="cx"> f = Failure()
</span><del>- self.log.error("Database key %s cannot be determined." % (self.versionKey,))
</del><ins>+ self.log.error("Database key {key} cannot be determined.", key=self.versionKey)
</ins><span class="cx"> yield sqlTxn.abort()
</span><span class="cx"> if self.defaultKeyValue is None:
</span><span class="cx"> f.raiseException()
</span><span class="cx"> else:
</span><span class="cx"> actual_version = self.defaultKeyValue
</span><span class="cx">
</span><del>- self.log.warn("Actual database key %s: %s." % (self.versionKey, actual_version,))
</del><ins>+ self.log.warn("Actual database key {key}: {vers}.", key=self.versionKey, vers=actual_version)
</ins><span class="cx">
</span><span class="cx"> returnValue((dialect, required_version, actual_version,))
</span><span class="cx">
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx"> looking for upgrade_from_X_to_Y.sql files that cover the full range of upgrades.
</span><span class="cx"> """
</span><span class="cx">
</span><del>- self.log.warn("Starting %s upgrade from version %d to %d." % (self.versionDescriptor, fromVersion, toVersion,))
</del><ins>+ self.log.warn("Starting {vers} upgrade from version {fr} to {to}.", vers=self.versionDescriptor, fr=fromVersion, to=toVersion)
</ins><span class="cx">
</span><span class="cx"> # Scan for all possible upgrade files - returned sorted
</span><span class="cx"> files = self.scanForUpgradeFiles(dialect)
</span><span class="lines">@@ -210,10 +210,10 @@
</span><span class="cx"> for fp in upgrades:
</span><span class="cx"> yield self.applyUpgrade(fp)
</span><span class="cx"> except RuntimeError:
</span><del>- self.log.error("Database %s upgrade failed using: %s" % (self.versionDescriptor, fp.basename(),))
</del><ins>+ self.log.error("Database {vers} upgrade failed using: {path}", vers=self.versionDescriptor, path=fp.basename())
</ins><span class="cx"> raise
</span><span class="cx">
</span><del>- self.log.warn("%s upgraded from version %d to %d." % (self.versionDescriptor.capitalize(), fromVersion, toVersion,))
</del><ins>+ self.log.warn("{vers} upgraded from version {fr} to {o}.", vers=self.versionDescriptor.capitalize(), fr=fromVersion, to=toVersion)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def getPathToUpgrades(self, dialect):
</span><span class="lines">@@ -312,7 +312,7 @@
</span><span class="cx"> """
</span><span class="cx"> Apply the schema upgrade .sql file to the database.
</span><span class="cx"> """
</span><del>- self.log.warn("Applying schema upgrade: %s" % (fp.basename(),))
</del><ins>+ self.log.warn("Applying schema upgrade: {path}", path=fp.basename())
</ins><span class="cx"> sqlTxn = self.sqlStore.newTransaction(label="UpgradeDatabaseSchemaStep.applyUpgrade")
</span><span class="cx"> try:
</span><span class="cx"> sql = fp.getContent()
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx"> self.log.error(msg)
</span><span class="cx"> raise RuntimeError(msg)
</span><span class="cx">
</span><del>- self.log.warn("Applying data upgrade: %s" % (module,))
</del><ins>+ self.log.warn("Applying data upgrade: {module}", module=module)
</ins><span class="cx"> yield doUpgrade(self.sqlStore)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -467,7 +467,7 @@
</span><span class="cx"> """
</span><span class="cx"> Do upgrades.
</span><span class="cx"> """
</span><del>- self.log.warn("Beginning database %s check." % (self.versionDescriptor,))
</del><ins>+ self.log.warn("Beginning database {vers} check.", vers=self.versionDescriptor)
</ins><span class="cx">
</span><span class="cx"> # Do each upgrade in our own predefined order
</span><span class="cx"> self.sqlStore.setUpgrading(True)
</span><span class="lines">@@ -477,6 +477,6 @@
</span><span class="cx">
</span><span class="cx"> self.sqlStore.setUpgrading(False)
</span><span class="cx">
</span><del>- self.log.warn("Database %s check complete." % (self.versionDescriptor,))
</del><ins>+ self.log.warn("Database {vers} check complete.", vers=self.versionDescriptor)
</ins><span class="cx">
</span><span class="cx"> returnValue(None)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreworkinbox_cleanuppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/inbox_cleanup.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/inbox_cleanup.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/inbox_cleanup.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -64,8 +64,10 @@
</span><span class="cx"> ).on(self.transaction))[0][0]
</span><span class="cx">
</span><span class="cx"> if queuedCleanupOneInboxWorkItems:
</span><del>- log.error("Inbox cleanup work: Can't schedule per home cleanup because {} work items still queued.".format(
- queuedCleanupOneInboxWorkItems))
</del><ins>+ log.error(
+ "Inbox cleanup work: Can't schedule per home cleanup because {} work items still queued.",
+ queuedCleanupOneInboxWorkItems
+ )
</ins><span class="cx"> else:
</span><span class="cx"> # enumerate provisioned normal calendar homes
</span><span class="cx"> ch = schema.CALENDAR_HOME
</span><span class="lines">@@ -95,8 +97,10 @@
</span><span class="cx"> ))
</span><span class="cx"> if orphanNames:
</span><span class="cx"> home = yield self.transaction.calendarHomeWithResourceID(self.homeID)
</span><del>- log.info("Inbox cleanup work in home: {homeUID}, deleting orphaned items: {orphanNames}".format(
- homeUID=home.uid(), orphanNames=orphanNames))
</del><ins>+ log.info(
+ "Inbox cleanup work in home: {homeUID}, deleting orphaned items: {orphanNames}",
+ homeUID=home.uid(), orphanNames=orphanNames,
+ )
</ins><span class="cx">
</span><span class="cx"> # get old item names
</span><span class="cx"> if float(config.InboxCleanup.ItemLifetimeDays) >= 0: # use -1 to disable; 0 is test case
</span><span class="lines">@@ -107,8 +111,10 @@
</span><span class="cx"> newDeleters = oldItemNames - orphanNames
</span><span class="cx"> if newDeleters:
</span><span class="cx"> home = yield self.transaction.calendarHomeWithResourceID(self.homeID)
</span><del>- log.info("Inbox cleanup work in home: {homeUID}, deleting old items: {newDeleters}".format(
- homeUID=home.uid(), newDeleters=newDeleters))
</del><ins>+ log.info(
+ "Inbox cleanup work in home: {homeUID}, deleting old items: {newDeleters}",
+ homeUID=home.uid(), newDeleters=newDeleters,
+ )
</ins><span class="cx"> else:
</span><span class="cx"> oldItemNames = set()
</span><span class="cx">
</span><span class="lines">@@ -121,8 +127,10 @@
</span><span class="cx"> newDeleters = itemNamesForOldEvents - oldItemNames - orphanNames
</span><span class="cx"> if newDeleters:
</span><span class="cx"> home = yield self.transaction.calendarHomeWithResourceID(self.homeID)
</span><del>- log.info("Inbox cleanup work in home: {homeUID}, deleting items for old events: {newDeleters}".format(
- homeUID=home.uid(), newDeleters=newDeleters))
</del><ins>+ log.info(
+ "Inbox cleanup work in home: {homeUID}, deleting items for old events: {newDeleters}",
+ homeUID=home.uid(), newDeleters=newDeleters,
+ )
</ins><span class="cx"> else:
</span><span class="cx"> itemNamesForOldEvents = set()
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavcommondatastoreworkload_workpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/load_work.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/load_work.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/common/datastore/work/load_work.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -66,11 +66,11 @@
</span><span class="cx"> All this work does is wait for the specified amount of time.
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug("TestWork started: {}".format(self.jobID))
</del><ins>+ log.debug("TestWork started: {jobid}", jobid=self.jobID)
</ins><span class="cx"> if self.delay != 0:
</span><span class="cx"> wait = Deferred()
</span><span class="cx"> def _timedDeferred():
</span><span class="cx"> wait.callback(True)
</span><span class="cx"> reactor.callLater(self.delay / 1000.0, _timedDeferred)
</span><span class="cx"> yield wait
</span><del>- log.debug("TestWork done: {}".format(self.jobID))
</del><ins>+ log.debug("TestWork done: {jobid}", jobid=self.jobID)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavdpsserverpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/dps/server.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/dps/server.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/dps/server.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -18,11 +18,13 @@
</span><span class="cx"> import datetime
</span><span class="cx"> import uuid
</span><span class="cx">
</span><ins>+from calendarserver.tap.caldav import ErrorLoggingMultiService
</ins><span class="cx"> from calendarserver.tap.util import getDBPool, storeFromConfigWithDPSServer
</span><ins>+
</ins><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twext.who.expression import MatchType, MatchFlags, Operand
</span><ins>+
</ins><span class="cx"> from twisted.application import service
</span><del>-from twisted.application.service import MultiService
</del><span class="cx"> from twisted.application.strports import service as strPortsService
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.internet.protocol import Factory
</span><span class="lines">@@ -33,6 +35,7 @@
</span><span class="cx"> from twistedcaldav import memcachepool
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG, DEFAULT_CONFIG_FILE
</span><ins>+
</ins><span class="cx"> from txdav.dps.commands import (
</span><span class="cx"> RecordWithShortNameCommand, RecordWithUIDCommand, RecordWithGUIDCommand,
</span><span class="cx"> RecordsWithRecordTypeCommand, RecordsWithEmailAddressCommand,
</span><span class="lines">@@ -45,6 +48,7 @@
</span><span class="cx"> UpdateRecordsCommand, FlushCommand, # RemoveRecordsCommand,
</span><span class="cx"> )
</span><span class="cx"> from txdav.who.wiki import WikiAccessLevel
</span><ins>+
</ins><span class="cx"> from zope.interface import implementer
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -808,7 +812,8 @@
</span><span class="cx"> else:
</span><span class="cx"> setproctitle("CalendarServer Directory Proxy Service")
</span><span class="cx">
</span><del>- multiService = MultiService()
</del><ins>+ # Setup default logging behavior
+ multiService = ErrorLoggingMultiService(False, "", 0, 0, False)
</ins><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> pool, txnFactory = getDBPool(config)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavwhodelegatespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/who/delegates.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/who/delegates.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/who/delegates.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -500,11 +500,11 @@
</span><span class="cx"> # Try cache first
</span><span class="cx"> delegateUIDs = yield self._memcacher.getMembers(delegator.uid, readWrite, expanded)
</span><span class="cx"> if delegateUIDs is not None:
</span><del>- log.debug("_delegatesOfUIDs cached for: {} and read-write = {} and expanded = {}".format(delegator.uid, readWrite, expanded,))
</del><ins>+ log.debug("_delegatesOfUIDs cached for: {uid} and read-write = {rw} and expanded = {expanded}", uid=delegator.uid, rw=readWrite, expanded=expanded)
</ins><span class="cx"> returnValue(delegateUIDs)
</span><span class="cx">
</span><span class="cx"> # Get from the store
</span><del>- log.debug("_delegatesOfUIDs for: {} and read-write = {} and expanded = {}".format(delegator.uid, readWrite, expanded,))
</del><ins>+ log.debug("_delegatesOfUIDs for: {uid} and read-write = {rw} and expanded = {expanded}", uid=delegator.uid, rw=readWrite, expanded=expanded)
</ins><span class="cx"> if delegator.thisServer():
</span><span class="cx"> delegateUIDs = yield txn.delegates(delegator.uid, readWrite, expanded=expanded)
</span><span class="cx">
</span><span class="lines">@@ -539,11 +539,11 @@
</span><span class="cx"> # Try cache first
</span><span class="cx"> delegatorUIDs = yield self._memcacher.getMemberships(delegate.uid, readWrite)
</span><span class="cx"> if delegatorUIDs is not None:
</span><del>- log.debug("_delegatedToUIDs cached for: {} and read-write = {}".format(delegate.uid, readWrite,))
</del><ins>+ log.debug("_delegatedToUIDs cached for: {uid} and read-write = {rw}", uid=delegate.uid, rw=readWrite)
</ins><span class="cx"> returnValue(delegatorUIDs)
</span><span class="cx">
</span><span class="cx"> # Get from the store
</span><del>- log.debug("_delegatedToUIDs for: {} and read-write = {}".format(delegate.uid, readWrite,))
</del><ins>+ log.debug("_delegatedToUIDs for: {uid} and read-write = {rw}", uid=delegate.uid, rw=readWrite)
</ins><span class="cx"> delegatorUIDs = (yield txn.delegators(delegate.uid, readWrite))
</span><span class="cx"> if not onlyThisServer and config.Servers.Enabled:
</span><span class="cx"> delegatorUIDs.update((yield self._podDelegators(txn, delegate, readWrite)))
</span><span class="lines">@@ -583,7 +583,7 @@
</span><span class="cx"> @rtype: a Deferred which fires a set of L{str}
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug("_podDelegates for: {} and read-write = {} and expanded = {}".format(delegator.uid, readWrite, expanded,))
</del><ins>+ log.debug("_podDelegates for: {uid} and read-write = {rw} and expanded = {expanded}", uid=delegator.uid, rw=readWrite, expanded=expanded)
</ins><span class="cx"> return txn.store().conduit.send_get_delegates(txn, delegator, readWrite, expanded)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -601,7 +601,7 @@
</span><span class="cx"> @rtype: a Deferred which fires a set of L{str}
</span><span class="cx"> """
</span><span class="cx">
</span><del>- log.debug("_podDelegators for: {} and read-write = {}".format(delegate.uid, readWrite,))
</del><ins>+ log.debug("_podDelegators for: {uid} and read-write = {rw}", uid=delegate.uid, rw=readWrite)
</ins><span class="cx"> results = yield DeferredList([
</span><span class="cx"> txn.store().conduit.send_get_delegators(txn, server, delegate, readWrite) for
</span><span class="cx"> server in txn.directoryService().serversDB().allServersExceptThis()
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/who/directory.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/who/directory.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/who/directory.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -448,12 +448,12 @@
</span><span class="cx"> # if config.EnableSACLs and self.CheckSACL:
</span><span class="cx"> # username = self.shortNames[0]
</span><span class="cx"> # if self.CheckSACL(username, "calendar") != 0:
</span><del>- # self.log.debug("%s is not enabled for calendaring due to SACL"
- # % (username,))
</del><ins>+ # self.log.debug("{user} is not enabled for calendaring due to SACL"
+ # user=username)
</ins><span class="cx"> # self.enabledForCalendaring = False
</span><span class="cx"> # if self.CheckSACL(username, "addressbook") != 0:
</span><del>- # self.log.debug("%s is not enabled for addressbooks due to SACL"
- # % (username,))
</del><ins>+ # self.log.debug("{user} is not enabled for addressbooks due to SACL"
+ # user=username)
</ins><span class="cx"> # self.enabledForAddressBooks = False
</span><span class="cx">
</span><span class="cx"> @property
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxdavxmlbasepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txdav/xml/base.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txdav/xml/base.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txdav/xml/base.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -214,8 +214,8 @@
</span><span class="cx"> else:
</span><span class="cx"> if not (isinstance(child, PCDATAElement) and child.isWhitespace()):
</span><span class="cx"> log.debug(
</span><del>- "Child of type %s is unexpected and therefore ignored in %s element"
- % (child.sname(), self.sname())
</del><ins>+ "Child of type {child} is unexpected and therefore ignored in {this} element",
+ child=child.sname(), this=self.sname(),
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> for qname, (min, max) in allowed_children.items():
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx"> if self.allowed_attributes:
</span><span class="cx"> for name in attributes:
</span><span class="cx"> if name not in self.allowed_attributes:
</span><del>- log.debug("Attribute %s is unexpected in %s element" % (name, self.sname()))
</del><ins>+ log.debug("Attribute {attr} is unexpected in {this} element", attr=name, this=self.sname())
</ins><span class="cx"> my_attributes[name] = attributes[name]
</span><span class="cx">
</span><span class="cx"> for name, required in self.allowed_attributes.items():
</span><span class="lines">@@ -243,8 +243,7 @@
</span><span class="cx">
</span><span class="cx"> else:
</span><span class="cx"> if not isinstance(self, WebDAVUnknownElement) and attributes:
</span><del>- log.debug("Attributes %s are unexpected in %s element"
- % (attributes.keys(), self.sname()))
</del><ins>+ log.debug("Attributes {attrs} are unexpected in {this} element", attrs=attributes.keys(), this=self.sname())
</ins><span class="cx"> my_attributes.update(attributes)
</span><span class="cx">
</span><span class="cx"> self.attributes = my_attributes
</span><span class="lines">@@ -390,7 +389,7 @@
</span><span class="cx"> try:
</span><span class="cx"> child.addToDOM(document, element)
</span><span class="cx"> except:
</span><del>- log.error("Unable to add child %r of element %s to DOM" % (child, self))
</del><ins>+ log.error("Unable to add child {child!r} of element {this!r} to DOM", child=child, this=self)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -511,7 +510,7 @@
</span><span class="cx"> try:
</span><span class="cx"> parent.appendChild(self.element(document))
</span><span class="cx"> except TypeError:
</span><del>- log.error("Invalid PCDATA: %r" % (self.data,))
</del><ins>+ log.error("Invalid PCDATA: {data!r}", data=self.data)
</ins><span class="cx"> raise
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxweb2davhttppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txweb2/dav/http.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txweb2/dav/http.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txweb2/dav/http.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -191,8 +191,8 @@
</span><span class="cx">
</span><span class="cx"> if code > 400: # Error codes only
</span><span class="cx"> log.error(
</span><del>- "Error during {method} for {path}: {message}",
- method=self.method, path=path, message=message
</del><ins>+ "Error during {method} for {path}: {msg}",
+ method=self.method, path=path, msg=message
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> uri = path[self.path_basename_len:]
</span><span class="lines">@@ -264,8 +264,8 @@
</span><span class="cx">
</span><span class="cx"> if code > 400: # Error codes only
</span><span class="cx"> log.error(
</span><del>- "Error during {method} for {property}: {message}",
- method=self.method, property=property, message=message
</del><ins>+ "Error during {method} for {property}: {msg}",
+ method=self.method, property=property, msg=message
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> children = []
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxweb2httppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txweb2/http.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txweb2/http.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txweb2/http.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -492,7 +492,7 @@
</span><span class="cx">
</span><span class="cx"> def _error(self, reason):
</span><span class="cx"> if reason.check(error.ConnectionLost):
</span><del>- log.info("Request error: {message}", message=reason.getErrorMessage())
</del><ins>+ log.info("Request error: {msg}", msg=reason.getErrorMessage())
</ins><span class="cx"> else:
</span><span class="cx"> log.failure("Request error", reason)
</span><span class="cx"> # Only bother with cleanup on errors other than lost connection.
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboonewlogtxweb2logpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/newlog/txweb2/log.py (15300 => 15301)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/newlog/txweb2/log.py        2015-11-10 00:00:49 UTC (rev 15300)
+++ CalendarServer/branches/users/cdaboo/newlog/txweb2/log.py        2015-11-10 00:06:26 UTC (rev 15301)
</span><span class="lines">@@ -212,12 +212,12 @@
</span><span class="cx"> def start(self):
</span><span class="cx"> """Start observing log events."""
</span><span class="cx"> # Use the root publisher to bypass log level filtering
</span><del>- log.publisher.addObserver(self.emit, filtered=False)
</del><ins>+ log.observer.addObserver(self.emit)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def stop(self):
</span><span class="cx"> """Stop observing log events."""
</span><del>- log.publisher.removeObserver(self.emit)
</del><ins>+ log.observer.removeObserver(self.emit)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>