<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>This was something that sounded like a good change but is extremely annoying in use. Once I get time I’m going to try writing an extension on Optional that generates a logDescription property so I don’t have to use that awful String(describing:) API.<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Jon Shier</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 5, 2017, at 10:35 AM, Shawn Erickson via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Avoid using optionals in string interpolation or make it explicit as the fix-it suggests.</div><div class=""><br class=""><div class="gmail_quote"><div class="">On Wed, Apr 5, 2017 at 7:27 AM Maxim Veksler via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg">Hi,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Swift 3.1 compiler seems to introduces a new complier warning regarding String(describing: )</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So this line:</div><div class="gmail_msg"><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'anonymous pro'; color: rgb(180, 38, 26);" class=""><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">Log</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">info</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">"Update name for user </span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">\</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">fbUser</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">)</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">"</span><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'anonymous pro'; color: rgb(180, 38, 26);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"><br class="gmail_msg"></span></div>Produces the warning: "note: use 'String(describing:)' to silence this warning"<div style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'anonymous pro'; color: rgb(180, 38, 26);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"><br class="gmail_msg"></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:'anonymous pro';color:rgb(180,38,26)" class="gmail_msg"><span style="font-variant-ligatures: no-common-ligatures;" class="gmail_msg"></span></p>and becomes this line</div><div class="gmail_msg"><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'anonymous pro';" class=""><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">Log</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">info</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">"Update name for user </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">\</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(describing: fbUser)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">"</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'anonymous pro'; color: rgb(180, 38, 26);" class=""><br class="gmail_msg"></div>This new syntax is not very sexy, especially for logging. Any suggestions, possibility on the API end of Log to make this warning go away? or write it differently.<br class="gmail_msg"></div></div>
_______________________________________________<br class="gmail_msg">
swift-users mailing list<br class="gmail_msg">
<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg">
</blockquote></div></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>