CleanroomLogger, a pure Swift logging engine

Over on some of the other Swift mailing lists, people have been asking about Swift logging engines; since this list seems to be the right place to discuss them, I hope you'll indulge me in letting you know about CleanroomLogger, a real logging engine written in pure Swift:

Why do I say it's a real logging engine? Because the other pure Swift loggers I've run across are all just wrappers around print().

Loggers that just call print() aren't actually sending messages to the system console; if you use these loggers and expect to read their output through Console.app, you'll be out of luck.

CleanroomLogger writes to the Apple System Log (ASL) facility, just like NSLog() does. But unlike NSLog(), which can bog down your app if not used judiciously, CleanroomLogger is designed to be performant, so you don't have to worry that your desire for diagnostics is going to kill your app's performance.

CleanroomLogger is mature enough to be shipping in significantly-revenue-generating apps, and the project now has over 500 stars on GitHub. I hope you'll find it useful.

In the meantime, if you're interested in furthering the state of Swift logging, please reach out to me. Alex Kolov has set up a swift-logging org on GitHub to help drive Swift logging standards; community involvement desired:

Thanks for your time,
E. Maloney
Gilt Groupe

Very exciting. Glad to see such projects emerge.

I hope that you’ll accept patches to make it cross-platform! And to include swift package manager support.

···

On Dec 9, 2015, at 12:53 PM, Evan Maloney via swift-users <swift-users@swift.org> wrote:

Over on some of the other Swift mailing lists, people have been asking about Swift logging engines; since this list seems to be the right place to discuss them, I hope you'll indulge me in letting you know about CleanroomLogger, a real logging engine written in pure Swift:

GitHub - emaloney/CleanroomLogger: CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant

Why do I say it's a real logging engine? Because the other pure Swift loggers I've run across are all just wrappers around print().

Loggers that just call print() aren't actually sending messages to the system console; if you use these loggers and expect to read their output through Console.app, you'll be out of luck.

CleanroomLogger writes to the Apple System Log (ASL) facility, just like NSLog() does. But unlike NSLog(), which can bog down your app if not used judiciously, CleanroomLogger is designed to be performant, so you don't have to worry that your desire for diagnostics is going to kill your app's performance.

CleanroomLogger is mature enough to be shipping in significantly-revenue-generating apps, and the project now has over 500 stars on GitHub. I hope you'll find it useful.

In the meantime, if you're interested in furthering the state of Swift logging, please reach out to me. Alex Kolov has set up a swift-logging org on GitHub to help drive Swift logging standards; community involvement desired:

swift-logging · GitHub

Thanks for your time,
E. Maloney
Gilt Groupe

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Very exciting. Glad to see such projects emerge.

I hope that you’ll accept patches to make it cross-platform! And to include swift package manager support.

Hi Max,

Being fully cross-platform is absolutely desired.

The CleanroomLogger API is designed to be platform-agnostic, although the underlying logging engine that it ships with and uses by default (CleanroomASL) relies on the Apple System Log facility, which as far as I know is limited to the four Apple platforms (iOS, Mac OS X, tvOS and watchOS).

That said, there's no reason another underlying log facility (such as one that might be Linux-compatible) couldn't be used underneath the CleanroomLogger API. I'd love for the CleanroomLogger API to be universally available on any Swift platform, and to ship with that support built-in.

Swift Package Manager support is a pre-requisite for that, because as of now CleanroomLogger only builds in Xcode. I hope to get a chance to add support shortly.

All the best,
E.

···

On Dec 9, 2015, at 3:55 PM, Max Howell <max.howell@apple.com> wrote:

On Dec 9, 2015, at 12:53 PM, Evan Maloney via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

Over on some of the other Swift mailing lists, people have been asking about Swift logging engines; since this list seems to be the right place to discuss them, I hope you'll indulge me in letting you know about CleanroomLogger, a real logging engine written in pure Swift:

GitHub - emaloney/CleanroomLogger: CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant

Why do I say it's a real logging engine? Because the other pure Swift loggers I've run across are all just wrappers around print().

Loggers that just call print() aren't actually sending messages to the system console; if you use these loggers and expect to read their output through Console.app, you'll be out of luck.

CleanroomLogger writes to the Apple System Log (ASL) facility, just like NSLog() does. But unlike NSLog(), which can bog down your app if not used judiciously, CleanroomLogger is designed to be performant, so you don't have to worry that your desire for diagnostics is going to kill your app's performance.

CleanroomLogger is mature enough to be shipping in significantly-revenue-generating apps, and the project now has over 500 stars on GitHub. I hope you'll find it useful.

In the meantime, if you're interested in furthering the state of Swift logging, please reach out to me. Alex Kolov has set up a swift-logging org on GitHub to help drive Swift logging standards; community involvement desired:

swift-logging · GitHub

Thanks for your time,
E. Maloney
Gilt Groupe

_______________________________________________
swift-users mailing list
swift-users@swift.org <mailto:swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users

Please port it. The PM is a bit buggy right now. It's difficult enough when the thing spits errors, but even worse when you don't really have a way to trace what you did. I'd attempt to use it.

Very exciting. Glad to see such projects emerge.

I hope that you’ll accept patches to make it cross-platform! And to include swift package manager support.

···

Sent from Outlook Mobile
On Wed, Dec 9, 2015 at 12:56 PM -0800, "Max Howell via swift-users" <swift-users@swift.org> wrote:

On Dec 9, 2015, at 12:53 PM, Evan Maloney via swift-users <swift-users@swift.org> wrote:

Over on some of the other Swift mailing lists, people have been asking about Swift logging engines; since this list seems to be the right place to discuss them, I hope you'll indulge me in letting you know about CleanroomLogger, a real logging engine written in pure Swift:

GitHub - emaloney/CleanroomLogger: CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant

Why do I say it's a real logging engine? Because the other pure Swift loggers I've run across are all just wrappers around print().

Loggers that just call print() aren't actually sending messages to the system console; if you use these loggers and expect to read their output through Console.app, you'll be out of luck.

CleanroomLogger writes to the Apple System Log (ASL) facility, just like NSLog() does. But unlike NSLog(), which can bog down your app if not used judiciously, CleanroomLogger is designed to be performant, so you don't have to worry that your desire for diagnostics is going to kill your app's performance.

CleanroomLogger is mature enough to be shipping in significantly-revenue-generating apps, and the project now has over 500 stars on GitHub. I hope you'll find it useful.

In the meantime, if you're interested in furthering the state of Swift logging, please reach out to me. Alex Kolov has set up a swift-logging org on GitHub to help drive Swift logging standards; community involvement desired:

swift-logging · GitHub

Thanks for your time,
E. Maloney
Gilt Groupe

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Thanks for the suggestion.

I took a stab at adding Swift package manager support to CleanroomLogger <https://github.com/emaloney/CleanroomLogger&gt;\. The trickiest part was getting the C headers for the Apple System Log exposed as a Swift module <https://github.com/emaloney/AppleSystemLogSwiftPackage&gt; so it could be imported by the CleanroomASL <https://github.com/emaloney/CleanroomASL&gt; dependency. (The Swift Package Manager doesn't support bridging headers, which makes hooking up to non-Swift code a bit cumbersome. Thanks to the kind folks on the swift-build-dev mailing list, I got it sorted.)

I built a command line tool with 'swift build' and was able to 'import CleanroomLogger' by specifying a dependency like the following in a Package.swift file:

import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/emaloney/CleanroomLogger&quot;, versions: Version(1,5,6) ..< Version(2,0,0))
    ]
)

With this package, I created a main.swift file:

import CleanroomLogger

Log.enable(synchronousMode: true)

Log.info?.trace()

And built & ran it from the Terminal:

   INFO | main.swift:5 — loggertest

It worked!!!

Very gratifying to see Swift package manager build something without too much effort.

···

On Dec 9, 2015, at 3:59 PM, Gage Morgan <gagemorgan@outlook.com> wrote:

Please port it. The PM is a bit buggy right now. It's difficult enough when the thing spits errors, but even worse when you don't really have a way to trace what you did. I'd attempt to use it.

Sent from Outlook Mobile <Bing;

On Wed, Dec 9, 2015 at 12:56 PM -0800, "Max Howell via swift-users" <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

Very exciting. Glad to see such projects emerge.

I hope that you’ll accept patches to make it cross-platform! And to include swift package manager support.

On Dec 9, 2015, at 12:53 PM, Evan Maloney via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

Over on some of the other Swift mailing lists, people have been asking about Swift logging engines; since this list seems to be the right place to discuss them, I hope you'll indulge me in letting you know about CleanroomLogger, a real logging engine written in pure Swift:

GitHub - emaloney/CleanroomLogger: CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant

Why do I say it's a real logging engine? Because the other pure Swift loggers I've run across are all just wrappers around print().

Loggers that just call print() aren't actually sending messages to the system console; if you use these loggers and expect to read their output through Console.app, you'll be out of luck.

CleanroomLogger writes to the Apple System Log (ASL) facility, just like NSLog() does. But unlike NSLog(), which can bog down your app if not used judiciously, CleanroomLogger is designed to be performant, so you don't have to worry that your desire for diagnostics is going to kill your app's performance.

CleanroomLogger is mature enough to be shipping in significantly-revenue-generating apps, and the project now has over 500 stars on GitHub. I hope you'll find it useful.

In the meantime, if you're interested in furthering the state of Swift logging, please reach out to me. Alex Kolov has set up a swift-logging org on GitHub to help drive Swift logging standards; community involvement desired:

swift-logging · GitHub

Thanks for your time,
E. Maloney
Gilt Groupe

_______________________________________________
swift-users mailing list
swift-users@swift.org <mailto:swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users

<Mail Attachment.txt>