manpagez: man pages & more
man os_log_create(3)
Home | html | info | man

os_log_create(3)         BSD Library Functions Manual         os_log_create(3)


     os_log_create -- create an object that tracks the state of logging for a
     given system.


     #include <os/log.h>

     os_log_create(const char *subsystem, const char *category);


     Use os_log_create to create an object that can be passed to os_log(3)
     calls.  Log messages to this object will be marked with the object's sub-
     system and category name.  The behavior of log messages to this object
     can be configured using the log(1) command.


     Create a new os_log_t object and log a message:

           #include <os/log.h>

           /* create a log object for the subsystem, specifically the "connections" category" */
           os_log_t log = os_log_create("com.example.widget", "connections");

           /* log a connection related message */
           os_log(log, "connection state changed: %d interface: %s", if, interface);


     log(1), os_log(3)

Darwin                         October 29, 2017                         Darwin

Mac OS X 10.12.6 - Generated Sun Oct 29 14:43:53 CDT 2017
© 2000-2024
Individual documents may contain additional copyright information.