steamclock / bluejay

A simple Swift framework for building reliable Bluetooth LE apps.
MIT License
1.09k stars 97 forks source link

Replace direct use of XCGLogger with just having debug messages passed back to client #237

Closed nbrooke closed 4 years ago

nbrooke commented 4 years ago

Fixes #221

Summary of Problem:

Currently Bluejay does a lot of its own logging management, directly depending on XCGLogger and keeping its own log files. This is okay for casual users, but a bit of a pain if you are doing anything complicated with your own logging (and is becoming annoying for us as we've upped our logging game in some of our projects depending on it)

Proposed Solution:

Rather than Bluejay having an XCGLogger instance and keeping it's own log files, the old LogObserver interface is replaced with one that just passes all debug logs straight through to the observer (or logs them with NSLog if there are no registered observers). This allows clients to implement whatever logging behaviour they want.

Testing Completed and Required:

Still a bit of a WIP PR, mainly being put up now so that I can use it in the project I'm making the change for without any local hacks. May still need some tweaks based on usage in that project.

sakuraehikaru commented 4 years ago

@nbrooke looks good to me so far, let me know when you need another final round of review and testing.