asl: unsetting keys not working
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=57d8j7S6V0Tg2iB3Voie3hQJRAWooAyVXBh7pcHcJd4=; b=ilJ51pvgQqGjH1X+GPnpFngQKLqO5En59FX3lqCbUZXVxga3fRgKRVjwAz1XEqQUBJ /M/MrZHRRXe/EjsWVTxhpd1fShr2CLfy6xhk/5YWwL4eZe2V57oNdhXN6ZJDZfBxrUGV DtRrLWgtAx79NYNA9GdsK8fyKVHnt8yBZVZHY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=IFswB1tHWbEWEhAtkqILeJSh86OEoytAoa+ACIC6RZqHGeBHF9HCQkn+K1SuS2WsBe or6KZOun85q0UxydZN0pRcUWYtvf7ouZaIr0vGnWXHm2gY/sZZPooNCkVBbN7aJYpvAg HX0dfeGgtF88Q8cErIc3WNF0t6EyEh7KxE20c= Folks, I'm testing a simple program that uses ASL. I would like to -not- print the host name, program name and level of the message. I thought I'm doing everything by the book but the keys I'm unsetting are still being printed. I want to see this Thu Oct 14 00:08:37 [12688]: Boom! but instead get without log_client: Thu Oct 14 00:08:37 biggie a.out[12688] <Debug>: Boom! and with log_client: Thu Oct 14 00:07:37 biggie foo[12672] <Debug>: Boom! What am I doing wrong? Thanks, Joel --- #include <unistd.h> #include <string.h> #include <asl.h> int main(int argc, char* argv[]) { char logtemp[32]; strcpy(logtemp, "/tmp/foo-XXXXXX.log"); // aslclient log_client = asl_open("foo", NULL, ASL_OPT_NO_DELAY); int fd = mkstemps(logtemp, 4); asl_add_log_file(NULL, fd); aslmsg log_msg = asl_new(ASL_TYPE_MSG); asl_unset(log_msg, ASL_KEY_HOST); asl_unset(log_msg, ASL_KEY_LEVEL); asl_unset(log_msg, ASL_KEY_SENDER); asl_unset(log_msg, ASL_KEY_FACILITY); asl_unset(log_msg, ASL_KEY_PID); asl_unset(log_msg, ASL_KEY_UID); asl_unset(log_msg, ASL_KEY_GID); asl_log(NULL, log_msg, ASL_LEVEL_DEBUG, "Boom!"); return 0; } --- http://twitter.com/wagerlabs _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Joel Reymont