Alternatively, use NSLog() which writes to the system log as well:
NSLog("i=%ld, x=%f, status=%@", 123, 34.56, "OK")
Note also that on OS X, syslog() is just a wrapper to the
"Apple System Logger facility". You can call
the asl_XXX functions directly, you only have to #include <asl.h>
in the bridging header file. As above, asl_log() is not
imported to Swift and you have to call asl_vlog() instead.
The problem is that
takes a variable argument list and is not imported to Swift. You can use
instead and define a wrapper function in Swift:
Note that string arguments have to be passed as C strings:
Alternatively, use
NSLog()
which writes to the system log as well:Note also that on OS X,
syslog()
is just a wrapper to the "Apple System Logger facility". You can call theasl_XXX
functions directly, you only have to#include <asl.h>
in the bridging header file. As above,asl_log()
is not imported to Swift and you have to callasl_vlog()
instead.