Search code examples
swiftloggingxcglogger

Does XCGLogger use os_log for fast logging?


I am comparing CleanRoomLogger https://github.com/emaloney/CleanroomLogger with XCGLogger https://github.com/DaveWoodCom/XCGLogger. There are many similarities but XCG seemed to be better because

1) it provides filters on the basis of tags

2) easy integration to 3rd party libraries if we want to push the logs to the server

However, Cleanroomlogger claims that it logs faster because it is built on top of os_log. Does anybody know how XCG handles fast logging? Or any other merits of one over the other?

Thanks.


Solution

  • Currently XCGLogger does not use os_log. I (the developer of XCGLogger) haven't added support for it yet. However, since XCGLogger is modular, you could create a new log destination that uses os_log if you need it. I'd appreciate a pull request if you do so that I can add it to the project for others.

    Apple's docs for os_log are here: https://developer.apple.com/documentation/os/logging

    Alternatively, if you really need it in a short period of time, you could sponsor the development of it. Get in touch with me if you'd like to pursue that option.