• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
asl: unsetting keys not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asl: unsetting keys not working


  • Subject: asl: unsetting keys not working
  • From: Joel Reymont <email@hidden>
  • Date: Thu, 14 Oct 2010 00:15:16 +0800

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: asl: unsetting keys not working
      • From: Marc Majka <email@hidden>
  • Prev by Date: Re: Is it possible to load 64-bit EFI in Mac Pro
  • Next by Date: ASL: log as a circular buffer
  • Previous by thread: Re: Is it possible to load 64-bit EFI in Mac Pro
  • Next by thread: Re: asl: unsetting keys not working
  • Index(es):
    • Date
    • Thread