TIL asl – Apple System Log

Today I noticed a strange behaviour in my Xcode’s console. I was testing iOS app background launch, more specifically, the case when the app is launched in background due to Watch Connectivity sendMessage method called on watchOS side. I was using “Wait for the executable to be launched” to get some console logs, but none appeared, except one:

10.22.0 – [FirebaseCore][I-COR000004] App with name FvFirebaseApp does not exist.

So I figured that Firebase uses something different than Foundation’s print or NSLog to print its logs and errors. By looking at source code, I found that the message is printed with FIRLogError, which calls GULLogBasic, which eventually calls asl_log.

It seems that Apple System Log was a previous attempt to unified logging, which later was superseded by os Logging:

asl(3)
These routines provide an interface to the Apple System Log facility.
They are intended to be a replacement for the syslog(3) API, which will continue to be supported for backwards compatibility. The new API allows client applications to create flexible, structured messages and send them to the syslogd server, where they may undergo additional processing.

I am not sure if it can be of any use now, as os_log is available from iOS 10. Probably Firebase uses it only because of legacy. But if for some reason you don’t get your messages in Xcode’s console and os Logging is not available, it may be an option to try.

Leave a comment