Hi,

A solution for this is to not use directly asl_log, but wrap it to a function that will then use asl_log for console, and fprintf for logging to stderr (instead of asl_open(stderr)), of course you will have to regenerate yourself date, host name, process name, process id information if needed when using fprintf.

Regards,
Yvan

Le 28 oct. 08 à 19:01, Karl Moskowski a écrit :

I've been experimenting with replacing my app's logging with Apple System Logger. When it comes to multi-byte characters, every thing looks OK in Console.app. However, Xcode's console shows things incorrectly. It probably won't come up often, but I'm wondering if it's fixable.

For example, this bit of code:
        NSLog(@"あ");
aslclient client = asl_open(NULL, NULL, ASL_OPT_STDERR); // add STDERR's fd to the connection's set of fds so things show up in Xcode's console
        asl_log(client, NULL, ASL_LEVEL_ERR, "あ");
        asl_close(client);

Results in this output in Xcode:
        2008-10-28 13:49:19.767 ASL[3484:10b] あ
        Tue Oct 28 13:49:19 iMac.local ASL[3484] <Error>: \M-c\M^A\M^B

The call to NSLog displays correctly, but asl_log doesn't.

(In case it doesn't survive email, the character in quotes is Hiragana Letter A, from Leopard's Character Palette > East Asian Scripts > Hiragana > first character.)

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to