[MacRuby-devel] Apple System Logger

Chris Hoffman cehoffman at gmail.com
Wed Feb 10 12:30:53 PST 2010


I've been trying to use the asl from macruby.  Accordingly I've created the necessary bridgesupport file from asl.h.  I can call asl_log just fine, but the issue comes when trying to customize the message.

For example, I'd like to have the output show up in Console.app.  To do this I need to

>> m = asl_new(ASL_TYPE_MSG)
>> asl_set(m, ASL_KEY_FACILITY, "com.apple.console")
>> asl_log(nil, m, ASL_LEVEL_INFO, "Shows up in console")

Unfortunately there is an error on the asl_new

TypeError: unrecognized runtime type `{__aslmsg=}'
	from /Users/cehoffman/Repos/Ruby/mp4tag/(irb):9:in `<main>'

Similarly trying to use client connections fails

>> asl_open($0, "com.apple.console", ASL_OPT_NO_DELAY)
TypeError: unrecognized runtime type `{__aslclient=}'
	from /Users/cehoffman/Repos/Ruby/mp4tag/(irb):4:in `<main>'

I was wondering what the next steps would be correct this since I have not encountered this error with BridgeSupport before.

P.S. I found an error in gen_bridge_metadata when creating 64-bit bridgesupport files. Setting headers directly bypassed the creation of the @import_directive which prevented the script from continuing.

Line 505:

g.headers = @headers

should be the following or similar to set @import_directive

@headers.each { |header| g.add_header(header) }


More information about the MacRuby-devel mailing list