<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I agree we need as minimal interface in the core library as possible while allowing application to take over whole logging configuration process.</div><div id="AppleMailSignature">Specific formatters, handlers and such will have to be implemented as external packages of course.&nbsp;</div><div id="AppleMailSignature"><br>Sent from my iPhone</div><div><br>On Dec 5, 2015, at 10:05 PM, David Waite &lt;<a href="mailto:david@alkaline-solutions.com">david@alkaline-solutions.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8">I would propose the simplest interface that I can assume is available *everywhere* to be defined by the Swift standard library, so as a framework developer I can make assumptions on my ability to provide diagnostics for internals, expose information for statistical use, provide information needed for auditing usage if I’m working on a hosted service and not a GUI app, and so on.<div class=""><br class=""></div><div class="">Things like custom formatters and appenders providing integration into remote/system services are something that the application can decide when it chooses a logging framework that implements the standard-defined protocol.</div><div class=""><br class=""></div><div class="">There isn’t any sort of dependency injection/inversion of control at the core swift level, which usually means that either logging is done by global functions, or by a global factory returns an instance of some type implementing the logging protocol.</div><div class=""><br class=""></div><div class="">The only piece of this which jumps out as not pure swift would be default integration into something like syslog or NSLog, and possibly adding a new preprocessor “macro” like __MODULE__&nbsp;</div><div class=""><div class=""><br class=""></div><div class="">-DW<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 5, 2015, at 1:20 PM, Kevin Barrett via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+1 to this.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Dec 5, 2015 at 2:24 PM, Alexander Kolov via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi everyone,<div class=""><br class=""></div><div class="">Coming from a short discussion in swift-corelibs-dev, I’m investigating the need of a standard logging API as a part of core libraries.</div><div class=""><br class=""></div><div class="">The motivation behind this would be having a unified and configurable set of APIs between all first-party modules and third party applications and libraries.</div><div class="">I think this will help each of us since right now we’re inventing our own solutions as well many bigger third-party library providers have formats and facilities of their own.</div><div class=""><br class=""></div><div class="">As I currently see it would be somewhat similar to python logging and possibly even structlog (<a href="http://www.structlog.org/en/stable/" target="_blank" class="">http://www.structlog.org/en/stable/</a>), with configurable formatters and handlers, including and not limited to remote loggers and syslog support.</div><div class=""><br class=""></div><div class="">I’d love to hear your opinions and feedback on this and possibly start with some more formalized proposal and implementation if there’s enough support and need.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Alex</div><div class=""><br class=""></div><div class=""><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=00EpKE8ePYlNiSQ-2BPX2qPErPWf-2B03BL81g4i7CEfsP8Hq0NE-2FWxgYf454PVecfk22bAwWstM-2FV6vCDlA6xFXx3Nefk8DQh-2FcFg5Wg028RO8DpuPBEKXLBRQDakKZgZ1cN6isUw7Dp-2BBj5J-2Bzez1lnF2vJ6O-2FxijMZbpC-2B12ocXa9hEMRObJdaXECuWGD4i2YwzC61we27jGqlrvRsEnEfbT79nWxbAMql6QcCof-2BIjE-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</div>
<br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=nE9rxSXA5G4kxsTVkgv43vFcOQoCM-2FU-2BigXPSqPoICLgjcAvLEPJP0sEYZqAEFE7yZfrkw0xcB2XOWTrB5Xo2x9kVBRD4krZZkOBfheV-2BVQBCeL9jwwLRa-2F2qoknzT4BuahuERCuA4Fizo-2BIao1kW5n-2BuKLlugWErkcT5haNxQ9rl6MAc8usf-2Fg5rw-2FOo7IiJYSOifXeaahkhIjxJ2iEj-2Ba8XWUR5UpJzNo8lzdQik0-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></body></html>