asl_out_rule_t *r;
asl_out_dst_data_t store, opts, *asl_store_dst = NULL;
const char *mname = NULL;
- char *path = NULL;
bool quiet = false;
bool cache_delete = false;
bool cache_delete_query = false;
if (!quiet)
{
+ char *path = NULL;
int status = asl_make_database_dir(NULL, NULL);
if (status == 0) status = asl_make_database_dir(ASL_INTERNAL_LOGS_DIR, &path);
if (status == 0)
free(str);
}
}
+ free(path);
}
/* get parameters from asl.conf */
}
}
- if (asl_store_dst->path == NULL) asl_store_dst->path = strdup(PATH_ASL_STORE);
+ if (asl_store_dst != NULL && asl_store_dst->path == NULL) asl_store_dst->path = strdup(PATH_ASL_STORE);
debug_log(ASL_LEVEL_ERR, "aslmanager starting%s\n", dryrun ? " dryrun" : "");
typedef asl_object_t aslresponse;
/*! @header
+ * These routines are deprecated and replaced by os_log(3). On OS versions
+ * with os_log(3), the ASL routines for emitting log messages are shimmed into
+ * the equivalent os_log functionality. Functions whose deprecation messages
+ * indicate they are unsupported will have no effect on OS versions with
+ * os_log(3) support.
+ *
* These routines provide an interface to the Apple System Log facility.
* The API allows client applications to create flexible, structured messages
* and send them to the syslogd server. Messages received by the server are
* (input) Options (see Client Creation Options).
* @result Returns an ASL client handle (asl_object_t of type ASL_TYPE_CLIENT).
*/
-asl_object_t asl_open(const char *ident, const char *facility, uint32_t opts) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+asl_object_t asl_open(const char *ident, const char *facility, uint32_t opts) __API_DEPRECATED("os_log(3) has replaced asl(3); see os_log_create(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Open an ASL database or ASL data file for read or write access.
* (input) Options (see File and Store Open Options).
* @result Returns an ASL object of type ASL_TYPE_STORE or ASL_TYPE_FILE, or NULL on failure.
*/
-asl_object_t asl_open_path(const char *path, uint32_t opts) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_object_t asl_open_path(const char *path, uint32_t opts) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Shuts down a connection to the server.
* @param obj
* (input) An ASL object.
*/
-void asl_close(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+void asl_close(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Write log messages to the given file descriptor.
* (input) A file descriptor.
* @result Returns 0 on success, non-zero on failure.
*/
-int asl_add_log_file(asl_object_t client, int descriptor) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_add_log_file(asl_object_t client, int descriptor) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Write log messages to the given file descriptor.
* (input) A text encoding type.
* @result Returns 0 on success, non-zero on failure.
*/
-int asl_add_output_file(asl_object_t client, int fd, const char *mfmt, const char *tfmt, int filter, int text_encoding) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_add_output_file(asl_object_t client, int fd, const char *mfmt, const char *tfmt, int filter, int text_encoding) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Write log messages to the given file descriptor.
* (input) A filter value.
* @result Returns the previous filter value.
*/
-int asl_set_output_file_filter(asl_object_t client, int fd, int filter) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_set_output_file_filter(asl_object_t client, int fd, int filter) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Stop writing log messages to the given file descriptor.
- * The file descripter is not closed by this routine.
+ * The file descriptor is not closed by this routine.
*
* @param client
* (input) An ASL client handle (asl_object_t of type ASL_TYPE_CLIENT).
* (input) A file descriptor.
* @result Returns 0 on success, non-zero on failure.
*/
-int asl_remove_log_file(asl_object_t client, int descriptor) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_remove_log_file(asl_object_t client, int descriptor) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Set a filter for messages being sent to the server.
* (input) A filter value.
* @result Returns the previous filter value.
*/
-int asl_set_filter(asl_object_t client, int f) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_set_filter(asl_object_t client, int f) __API_DEPRECATED("os_log(3) has replaced asl(3); see log(1)'s config command", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*
* Examine attribute keys.
* @result Returns the key of the nth attribute in a message (beginning at zero),
* or NULL if n is greater than the largest message index.
*/
-const char *asl_key(asl_object_t msg, uint32_t n) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+const char *asl_key(asl_object_t msg, uint32_t n) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*
* Examine attribute keys.
* (input) An index value.
* @result returns 0 for success, non-zero for failure.
*/
-int asl_fetch_key_val_op(asl_object_t msg, uint32_t n, const char **key, const char **val, uint32_t *op) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_fetch_key_val_op(asl_object_t msg, uint32_t n, const char **key, const char **val, uint32_t *op) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Create a new log message, query message, message list, or a connection to the system database.
* The Sender and Facility values associated with an ASL_TYPE_CLIENT may
* be reset using asl_set().
*/
-asl_object_t asl_new(uint32_t type) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+asl_object_t asl_new(uint32_t type) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Set or re-set a message or query attribute.
* (input) Attribute value.
* @result returns 0 for success, non-zero for failure.
*/
-int asl_set(asl_object_t obj, const char *key, const char *value) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_set(asl_object_t obj, const char *key, const char *value) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Remove a key/value attribute.
* (input) Attribute key.
* returns 0 for success, non-zero for failure.
*/
-int asl_unset(asl_object_t obj, const char *key) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_unset(asl_object_t obj, const char *key) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Get the value associated with an attribute key.
* (input) Attribute key.
* @result Returns the attribute value, or NULL if the object does not contain the key.
*/
-const char *asl_get(asl_object_t msg, const char *key) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+const char *asl_get(asl_object_t msg, const char *key) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Log a message with a particular log level.
* The object type ASL_TYPE_QUERY is supported, but the key/value pairs set in the
* object will have an operator value of zero.
*/
-int asl_log(asl_object_t client, asl_object_t msg, int level, const char *format, ...) __printflike(4, 5) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_log(asl_object_t client, asl_object_t msg, int level, const char *format, ...) __printflike(4, 5) __not_tail_called __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Log a message with a particular log level.
* (input) A printf() - style format string followed by a list of arguments.
* @result Returns 0 for success, non-zero for failure.
*/
-int asl_log_message(int level, const char *format, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_log_message(int level, const char *format, ...) __printflike(2, 3) __not_tail_called __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Log a message with a particular log level.
* types of input object.
*
*/
-int asl_vlog(asl_object_t obj, asl_object_t msg, int level, const char *format, va_list ap) __printflike(4, 0) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_vlog(asl_object_t obj, asl_object_t msg, int level, const char *format, va_list ap) __printflike(4, 0) __not_tail_called __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Log a message.
* See the discussion for asl_log() for a description of how this routine treats different
* types of input object.
*/
-int asl_send(asl_object_t obj, asl_object_t msg) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_send(asl_object_t obj, asl_object_t msg) __not_tail_called __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* DEPRECATED: Free an ASL object and all internal resources associated with it.
* @param obj
* (input) An ASL object to free.
*/
-void asl_free(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+void asl_free(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Increment the internal reference count of an ASL object.
* (input) An ASL object to retain.
* @result Returns the object.
*/
-asl_object_t asl_retain(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_object_t asl_retain(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Decrement the internal reference count of an ASL object.
* @param obj
* (input) An ASL object to release.
*/
-void asl_release(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+void asl_release(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Get the internal type of an ASL object.
* (input) An ASL object.
* @result Returns the object type.
*/
-uint32_t asl_get_type(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+uint32_t asl_get_type(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Set arbitrary parameters of a query.
* (input) An operation (ASL_QUERY_OP_*)
* @result Returns 0 for success, non-zero for failure
*/
-int asl_set_query(asl_object_t msg, const char *key, const char *value, uint32_t op) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+int asl_set_query(asl_object_t msg, const char *key, const char *value, uint32_t op) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Search for messages matching the criteria described by an query object.
* If obj is of type ASL_TYPE_QUERY and query is of type ASL_TYPE_MSG, the routine returns NULL.
*
*/
-asl_object_t asl_search(asl_object_t obj, asl_object_t query) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
+asl_object_t asl_search(asl_object_t obj, asl_object_t query) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* DEPRECATED: Iterate over messages in an asl_object_t (same as an aslresponse).
* @param obj_to_add
* (input) An object of type ASL_TYPE_MSG, ASL_TYPE_QUERY or type ASL_TYPE_LIST.
*/
-void asl_append(asl_object_t obj, asl_object_t obj_to_add) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+void asl_append(asl_object_t obj, asl_object_t obj_to_add) __not_tail_called __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Prepend messages to an object of type ASL_TYPE_LIST. The input "obj"
* @param obj_to_add
* (input) An object of type ASL_TYPE_MSG, ASL_TYPE_QUERY or type ASL_TYPE_LIST.
*/
-void asl_prepend(asl_object_t obj, asl_object_t obj_to_add) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+void asl_prepend(asl_object_t obj, asl_object_t obj_to_add) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Get the number of key/value pairs in an object of type ASL_TYPE_MSG or ASL_TYPE_QUERY,
* Returns zero if object is empty or NULL, or if the type is not
* ASL_TYPE_MSG, ASL_TYPE_QUERY, or ASL_TYPE_LIST.
*/
-size_t asl_count(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+size_t asl_count(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Retreive a message from an object of type ASL_TYPE_LIST.
* @result Returns the message (an object of type ASL_TYPE_MSG or ASL_TYPE_QUERY) at the specified index.
* Returns NULL if the index is out of range or if list is not an object of type ASL_TYPE_LIST.
*/
-asl_object_t asl_get_index(asl_object_t list, size_t index) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_object_t asl_get_index(asl_object_t list, size_t index) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Remove the message at a specified index from an object of type ASL_TYPE_LIST.
* @param list
* (input) An object of type ASL_TYPE_LIST.
*/
-void asl_remove_index(asl_object_t list, size_t index) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+void asl_remove_index(asl_object_t list, size_t index) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Creates an auxiliary file that may be used to save arbitrary data. The ASL message msg
* (output) A writable file descriptor.
* @result Returns 0 for success, non-zero for failure
*/
-int asl_create_auxiliary_file(asl_object_t msg, const char *title, const char *uti, int *out_descriptor) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
+int asl_create_auxiliary_file(asl_object_t msg, const char *title, const char *uti, int *out_descriptor) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.7,10.12), ios(5.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Close an auxiliary file opened by asl_create_auxiliary_file() when writing is complete.
* (input) The file descriptor
* @result Returns 0 for success, non-zero for failure
*/
-int asl_close_auxiliary_file(int descriptor) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
+int asl_close_auxiliary_file(int descriptor) __API_DEPRECATED("os_log(3) has replaced asl(3); this functionality is no longer supported", macosx(10.7,10.12), ios(5.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Sends an ASL message to syslogd along with a title string, Uniform Resource Locator,
* (input) Uniform Type Locator
* @result Returns 0 for success, non-zero for failure
*/
-int asl_log_auxiliary_location(asl_object_t msg, const char *title, const char *uti, const char *url) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
+int asl_log_auxiliary_location(asl_object_t msg, const char *title, const char *uti, const char *url) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(5.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Creates an object of type ASL_TYPE_CLIENT for logging to a file descriptor.
* (input) Facility name
* @result An object of type ASL_TYPE_CLIENT.
*/
-asl_object_t asl_open_from_file(int descriptor, const char *ident, const char *facility) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_5_0);
+asl_object_t asl_open_from_file(int descriptor, const char *ident, const char *facility) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(5.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* This API provides functionality to use file descriptors to send logging
* (input) Either ASL_LOG_DESCRIPTOR_READ or ASL_LOG_DESCRIPTOR_WRITE
* @result Returns 0 for success, non-zero for failure
*/
-int asl_log_descriptor(asl_object_t asl, asl_object_t msg, int level, int descriptor, uint32_t fd_type) __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_5_1);
+int asl_log_descriptor(asl_object_t asl, asl_object_t msg, int level, int descriptor, uint32_t fd_type) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
#pragma mark -
* (input) Text encoding control (for special characters). See "Text Encoding Types".
* @result Returns a character string, or NULL in case of a failure.
*/
-char *asl_format(asl_object_t msg, const char *msg_fmt, const char *time_fmt, uint32_t text_encoding) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+char *asl_format(asl_object_t msg, const char *msg_fmt, const char *time_fmt, uint32_t text_encoding) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Encodes a buffer with embedded nul characters into a nul terminated C string.
* (input) Length (in octets) of data buffer.
* @result Returns an encoded character string.
*/
-char *asl_encode_buffer(const char *buf, size_t len) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+char *asl_encode_buffer(const char *buf, size_t len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Decodes a C string previously created by asl_encode_buffer back into a buffer,
* (input) Length (in octets) of data buffer.
* @result Returns 0 on success, non-zero on failure.
*/
-int asl_decode_buffer(const char *in, char **buf, size_t *len) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_decode_buffer(const char *in, char **buf, size_t *len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Iterate forward through messages in an asl_object_t.
* which should be of type ASL_TYPE_CLIENT, ASL_TYPE_LIST, ASL_TYPE_STORE, or ASL_TYPE_FILE.
* Returns NULL when there are no more messages or if obj is not a type that holds messages.
*/
-asl_object_t asl_next(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_object_t asl_next(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Iterate backwards through messages in an asl_object_t.
* which should be of type ASL_TYPE_CLIENT, ASL_TYPE_LIST, ASL_TYPE_STORE, or ASL_TYPE_FILE.
* Returns NULL when there are no more messages or if obj is not a type that holds messages.
*/
-asl_object_t asl_prev(asl_object_t obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_object_t asl_prev(asl_object_t obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Reset internal interation index in an asl_object_t.
* (input) Use 0 to position the internal interation index at the beginning of the asl_object_t object,
* and SIZE_MAX to position it at the end. Other values of position may cause unpredictable behavior.
*/
-void asl_reset_iteration(asl_object_t obj, size_t position) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+void asl_reset_iteration(asl_object_t obj, size_t position) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/*!
* Searches an asl_object_t.
* (input) ASL_MATCH_DIRECTION_FORWARD or ASL_MATCH_DIRECTION_REVERSE.
* @result Returns an ASL object containing messages matching the querylist, or NULL if there are no matches.
*/
-asl_object_t asl_match(asl_object_t data, asl_object_t querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_object_t asl_match(asl_object_t data, asl_object_t querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(8.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
__END_DECLS
const asl_jump_table_t *asl_client_jump_table(void);
-asl_client_t *asl_client_open(const char *ident, const char *facility, uint32_t opts) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_client_t *asl_client_open_from_file(int descriptor, const char *ident, const char *facility) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_client_t *asl_client_retain(asl_client_t *client) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_client_release(asl_client_t *client) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_client_t *asl_client_open(const char *ident, const char *facility, uint32_t opts) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_client_t *asl_client_open_from_file(int descriptor, const char *ident, const char *facility) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_client_t *asl_client_retain(asl_client_t *client) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_client_release(asl_client_t *client) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_client_set_filter(asl_client_t *client, int filter) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-ASL_STATUS asl_client_add_output_file(asl_client_t *client, int descriptor, const char *mfmt, const char *tfmt, int filter, int text_encoding) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-int asl_client_set_output_file_filter(asl_client_t *client, int fd, int filter) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-ASL_STATUS asl_client_remove_output_file(asl_client_t *client, int descriptor) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_client_set_filter(asl_client_t *client, int filter) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+ASL_STATUS asl_client_add_output_file(asl_client_t *client, int descriptor, const char *mfmt, const char *tfmt, int filter, int text_encoding) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int asl_client_set_output_file_filter(asl_client_t *client, int fd, int filter) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+ASL_STATUS asl_client_remove_output_file(asl_client_t *client, int descriptor) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_client_log_descriptor(asl_client_t *client, asl_msg_t *msg, int level, int descriptor, uint32_t fd_type) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_client_log_descriptor(asl_client_t *client, asl_msg_t *msg, int level, int descriptor, uint32_t fd_type) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_t *asl_client_kvdict(asl_client_t *client) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_msg_t *asl_client_kvdict(asl_client_t *client) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_client_log(asl_client_t *client, asl_msg_t *msg, int level, const char *format, ...) __printflike(4, 5) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-int asl_client_vlog(asl_client_t *client, asl_msg_t *msg, int level, const char *format, va_list ap) __printflike(4, 0) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-ASL_STATUS asl_client_send(asl_client_t *client, asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_client_log(asl_client_t *client, asl_msg_t *msg, int level, const char *format, ...) __printflike(4, 5) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int asl_client_vlog(asl_client_t *client, asl_msg_t *msg, int level, const char *format, va_list ap) __printflike(4, 0) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+ASL_STATUS asl_client_send(asl_client_t *client, asl_msg_t *msg) __not_tail_called __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_list_t *asl_client_search(asl_client_t *client, asl_msg_t *query) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_list_t *asl_client_match(asl_client_t *client, asl_msg_list_t *querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_msg_list_t *asl_client_search(asl_client_t *client, asl_msg_t *query) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_list_t *asl_client_match(asl_client_t *client, asl_msg_list_t *querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_client_set_control(asl_client_t *client, uint32_t filter) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
-uint32_t asl_client_get_control(asl_client_t *client) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
+uint32_t asl_client_set_control(asl_client_t *client, uint32_t filter) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.11,10.12), ios(9.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_client_get_control(asl_client_t *client) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.11,10.12), ios(9.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
__END_DECLS
#define ASL_PLACE_ARCHIVE_DEFAULT "/var/log/asl.archive"
#endif
-mach_port_t asl_core_get_service_port(int reset) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-
-uint32_t asl_core_string_hash(const char *str, uint32_t len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-const char *asl_core_error(uint32_t code) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-const char *asl_core_level_to_string(uint32_t level) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-uint32_t asl_core_check_access(int32_t msgu, int32_t msgg, int32_t readu, int32_t readg, uint16_t flags) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint64_t asl_core_htonq(uint64_t n) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint64_t asl_core_ntohq(uint64_t n)__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint64_t asl_core_new_msg_id(uint64_t start) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-char *asl_core_encode_buffer(const char *in, uint32_t len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0);
-int32_t asl_core_decode_buffer(const char *in, char **buf, uint32_t *len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0);
-
-time_t asl_core_parse_time(const char *in, uint32_t *tlen) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-size_t asl_core_str_to_size(char *s) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0); //TODO: 10_11 & 7_1 or 8_0
-time_t asl_core_str_to_time(char *s, uint32_t def_n) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0); //TODO: 10_11 & 7_1 or 8_0
-void asl_core_time_to_str(time_t s, char *str, size_t len) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0); //TODO: 10_11 & 7_1 or 8_0
-
-const char *asl_filesystem_path(uint32_t place) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+mach_port_t asl_core_get_service_port(int reset) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+
+uint32_t asl_core_string_hash(const char *str, uint32_t len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+const char *asl_core_error(uint32_t code) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+const char *asl_core_level_to_string(uint32_t level) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_core_check_access(int32_t msgu, int32_t msgg, int32_t readu, int32_t readg, uint16_t flags) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint64_t asl_core_htonq(uint64_t n) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint64_t asl_core_ntohq(uint64_t n)__API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint64_t asl_core_new_msg_id(uint64_t start) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+char *asl_core_encode_buffer(const char *in, uint32_t len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(5.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int32_t asl_core_decode_buffer(const char *in, char **buf, uint32_t *len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(5.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+
+time_t asl_core_parse_time(const char *in, uint32_t *tlen) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+size_t asl_core_str_to_size(char *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+time_t asl_core_str_to_time(char *s, uint32_t def_n) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_core_time_to_str(time_t s, char *str, size_t len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+
+const char *asl_filesystem_path(uint32_t place) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
#endif /* __ASL_CORE_H__ */
const asl_jump_table_t *asl_file_jump_table(void);
-asl_file_list_t *asl_file_list_add(asl_file_list_t *list, asl_file_t *f) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-void asl_file_list_close(asl_file_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+asl_file_list_t *asl_file_list_add(asl_file_list_t *list, asl_file_t *f) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_file_list_close(asl_file_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_file_t *asl_file_retain(asl_file_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_file_release(asl_file_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_file_t *asl_file_retain(asl_file_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_file_release(asl_file_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_file_open_write(const char *path, mode_t mode, uid_t uid, gid_t gid, asl_file_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_file_close(asl_file_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_file_open_write(const char *path, mode_t mode, uid_t uid, gid_t gid, asl_file_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_close(asl_file_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_file_save(asl_file_t *s, asl_msg_t *msg, uint64_t *mid) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_file_save(asl_file_t *s, asl_msg_t *msg, uint64_t *mid) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_file_open_read(const char *path, asl_file_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_file_fetch(asl_file_t *s, uint64_t mid, asl_msg_t **msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_file_open_read(const char *path, asl_file_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_fetch(asl_file_t *s, uint64_t mid, asl_msg_t **msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_file_read_set_position(asl_file_t *s, uint32_t pos) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_file_fetch_next(asl_file_t *s, asl_msg_t **msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_file_fetch_previous(asl_file_t *s, asl_msg_t **msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_file_read_set_position(asl_file_t *s, uint32_t pos) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_fetch_next(asl_file_t *s, asl_msg_t **msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_fetch_previous(asl_file_t *s, asl_msg_t **msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_list_t *asl_file_match(asl_file_t *s, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-asl_msg_list_t *asl_file_list_match(asl_file_list_t *list, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+asl_msg_list_t *asl_file_match(asl_file_t *s, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_list_t *asl_file_list_match(asl_file_list_t *list, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-void *asl_file_list_match_start(asl_file_list_t *list, uint64_t start_id, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_file_list_match_next(void *token, asl_msg_list_t *query, asl_msg_list_t **res, uint32_t count) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-void asl_file_list_match_end(void *token) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+void *asl_file_list_match_start(asl_file_list_t *list, uint64_t start_id, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_list_match_next(void *token, asl_msg_list_t *query, asl_msg_list_t **res, uint32_t count) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_file_list_match_end(void *token) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-size_t asl_file_size(asl_file_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint64_t asl_file_ctime(asl_file_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+size_t asl_file_size(asl_file_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint64_t asl_file_ctime(asl_file_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_file_compact(asl_file_t *s, const char *path, mode_t mode, uid_t uid, gid_t gid) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_file_filter(asl_file_t *s, const char *path, asl_msg_list_t *filter, uint32_t flags, mode_t mode, uid_t uid, gid_t gid, uint32_t *dstcount, void (*aux_callback)(const char *auxfile)) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-uint32_t asl_file_filter_level(asl_file_t *s, const char *path, uint32_t keep_mask, mode_t mode, uid_t uid, gid_t gid, uint32_t *dstcount, void (*aux_callback)(const char *auxfile)) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+uint32_t asl_file_compact(asl_file_t *s, const char *path, mode_t mode, uid_t uid, gid_t gid) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_filter(asl_file_t *s, const char *path, asl_msg_list_t *filter, uint32_t flags, mode_t mode, uid_t uid, gid_t gid, uint32_t *dstcount, void (*aux_callback)(const char *auxfile)) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_file_filter_level(asl_file_t *s, const char *path, uint32_t keep_mask, mode_t mode, uid_t uid, gid_t gid, uint32_t *dstcount, void (*aux_callback)(const char *auxfile)) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
__END_DECLS
FILE *db;
} asl_legacy1_t;
-uint32_t asl_legacy1_open(const char *path, asl_legacy1_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_legacy1_close(asl_legacy1_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_legacy1_fetch(asl_legacy1_t *s, uint64_t msgid, asl_msg_t **msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_legacy1_match(asl_legacy1_t *s, asl_msg_list_t *query, asl_msg_list_t **res, uint64_t *last, uint64_t start, uint32_t count, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_legacy1_open(const char *path, asl_legacy1_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_legacy1_close(asl_legacy1_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_legacy1_fetch(asl_legacy1_t *s, uint64_t msgid, asl_msg_t **msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_legacy1_match(asl_legacy1_t *s, asl_msg_list_t *query, asl_msg_list_t **res, uint64_t *last, uint64_t start, uint32_t count, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
#endif /*__ASL_LEGACY1_H__*/
const asl_jump_table_t *asl_msg_jump_table(void);
/* new/retain/release */
-asl_msg_t *asl_msg_new(uint32_t type) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-asl_msg_t *asl_msg_retain(asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-void asl_msg_release(asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
+asl_msg_t *asl_msg_new(uint32_t type) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_t *asl_msg_retain(asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_release(asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_msg_set_key_val(asl_msg_t *msg, const char *key, const char *val) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-int asl_msg_set_key_val_op(asl_msg_t *msg, const char *key, const char *val, uint32_t op) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-void asl_msg_unset(asl_msg_t *msg, const char *key) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-void asl_msg_unset_index(asl_msg_t *msg, uint32_t n) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_msg_set_key_val(asl_msg_t *msg, const char *key, const char *val) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int asl_msg_set_key_val_op(asl_msg_t *msg, const char *key, const char *val, uint32_t op) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_unset(asl_msg_t *msg, const char *key) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_unset_index(asl_msg_t *msg, uint32_t n) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_t *asl_msg_copy(asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_msg_t *asl_msg_merge(asl_msg_t *target, asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
+asl_msg_t *asl_msg_copy(asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_t *asl_msg_merge(asl_msg_t *target, asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_msg_lookup(asl_msg_t *msg, const char *key, const char **valout, uint16_t *opout) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-uint32_t asl_msg_fetch(asl_msg_t *msg, uint32_t n, const char **keyout, const char **valout, uint16_t *opout) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-const char *asl_msg_get_val_for_key(asl_msg_t *msg, const char *key) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_msg_lookup(asl_msg_t *msg, const char *key, const char **valout, uint16_t *opout) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_msg_fetch(asl_msg_t *msg, uint32_t n, const char **keyout, const char **valout, uint16_t *opout) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+const char *asl_msg_get_val_for_key(asl_msg_t *msg, const char *key) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_msg_type(asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-uint32_t asl_msg_count(asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
+uint32_t asl_msg_type(asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_msg_count(asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-char *asl_msg_to_string(asl_msg_t *in, uint32_t *len) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
-asl_msg_t *asl_msg_from_string(const char *buf) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_7_0);
+char *asl_msg_to_string(asl_msg_t *in, uint32_t *len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_t *asl_msg_from_string(const char *buf) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-char *asl_format_message(asl_msg_t *msg, const char *msg_fmt, const char *time_fmt, uint32_t text_encoding, uint32_t *outlen) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+char *asl_format_message(asl_msg_t *msg, const char *msg_fmt, const char *time_fmt, uint32_t text_encoding, uint32_t *outlen) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_string_t *asl_msg_to_string_raw(uint32_t encoding, asl_msg_t *msg, const char *tfmt) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t * asl_string_append_asl_msg(asl_string_t *str, asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_string_t *asl_msg_to_string_raw(uint32_t encoding, asl_msg_t *msg, const char *tfmt) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t * asl_string_append_asl_msg(asl_string_t *str, asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_msg_cmp(asl_msg_t *a, asl_msg_t *b) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_msg_cmp(asl_msg_t *a, asl_msg_t *b) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
void _asl_log_args_to_xpc(asl_object_t client, asl_object_t msg, xpc_object_t dict); //TODO: ADD AVAILABLITY INFO
const asl_jump_table_t *asl_msg_list_jump_table(void);
-char *asl_msg_list_to_string(asl_msg_list_t *list, uint32_t *len) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_string_t *asl_msg_list_to_asl_string(asl_msg_list_t *list, uint32_t encoding) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_list_t *asl_msg_list_from_string(const char *buf) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+char *asl_msg_list_to_string(asl_msg_list_t *list, uint32_t *len) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_msg_list_to_asl_string(asl_msg_list_t *list, uint32_t encoding) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_list_t *asl_msg_list_from_string(const char *buf) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_list_t *asl_msg_list_new(void) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_list_t *asl_msg_list_retain(asl_msg_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_msg_list_release(asl_msg_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_msg_list_t *asl_msg_list_new(void) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_list_t *asl_msg_list_retain(asl_msg_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_list_release(asl_msg_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_list_t *asl_msg_list_new_count(uint32_t n) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_msg_list_insert(asl_msg_list_t *list, uint32_t x, void *obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_msg_list_t *asl_msg_list_new_count(uint32_t n) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_list_insert(asl_msg_list_t *list, uint32_t x, void *obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-void asl_msg_list_append(asl_msg_list_t *list, void *obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_msg_list_prepend(asl_msg_list_t *list, void *obj) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-size_t asl_msg_list_count(asl_msg_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_t *asl_msg_list_get_index(asl_msg_list_t *list, size_t index) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_msg_list_remove_index(asl_msg_list_t *list, size_t index) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_t *asl_msg_list_next(asl_msg_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_t *asl_msg_list_prev(asl_msg_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_msg_list_reset_iteration(asl_msg_list_t *list, size_t position) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_list_t *asl_msg_list_search(asl_msg_list_t *list, asl_msg_t *query) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-asl_msg_list_t *asl_msg_list_match(asl_msg_list_t *list, asl_msg_list_t *querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+void asl_msg_list_append(asl_msg_list_t *list, void *obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_list_prepend(asl_msg_list_t *list, void *obj) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+size_t asl_msg_list_count(asl_msg_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_t *asl_msg_list_get_index(asl_msg_list_t *list, size_t index) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_list_remove_index(asl_msg_list_t *list, size_t index) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_t *asl_msg_list_next(asl_msg_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_t *asl_msg_list_prev(asl_msg_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_msg_list_reset_iteration(asl_msg_list_t *list, size_t position) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_list_t *asl_msg_list_search(asl_msg_list_t *list, asl_msg_t *query) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_msg_list_t *asl_msg_list_match(asl_msg_list_t *list, asl_msg_list_t *querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_list_t *asl_msg_search(asl_msg_t *msg, asl_msg_t *query) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-uint32_t asl_msg_match(asl_msg_t *msg, asl_msg_list_t *querylist, asl_msg_list_t **res, size_t *last, size_t start, size_t count, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+asl_msg_list_t *asl_msg_search(asl_msg_t *msg, asl_msg_t *query) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_msg_match(asl_msg_t *msg, asl_msg_list_t *querylist, asl_msg_list_t **res, size_t *last, size_t start, size_t count, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-int asl_msg_cmp_list(asl_msg_t *msg, asl_msg_list_t *list) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+int asl_msg_cmp_list(asl_msg_t *msg, asl_msg_list_t *list) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
__END_DECLS
asl_object_private_t *(*get_object_at_index)(asl_object_private_t *obj, size_t n);
void (*set_iteration_index)(asl_object_private_t *obj, size_t n);
void (*remove_object_at_index)(asl_object_private_t *obj, size_t n);
- void (*append)(asl_object_private_t *obj, asl_object_private_t *newobj);
+ void (*append)(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr);
void (*prepend)(asl_object_private_t *obj, asl_object_private_t *newobj);
asl_object_private_t *(*search)(asl_object_private_t *obj, asl_object_private_t *query);
asl_object_private_t *(*match)(asl_object_private_t *obj, asl_object_private_t *querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t dir);
asl_object_private_t *asl_object_get_object_at_index(asl_object_private_t *obj, size_t n);
void asl_object_set_iteration_index(asl_object_private_t *obj, size_t n);
void asl_object_remove_object_at_index(asl_object_private_t *obj, size_t n);
-void asl_object_append(asl_object_private_t *obj, asl_object_private_t *newobj);
+void asl_object_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr);
void asl_object_prepend(asl_object_private_t *obj, asl_object_private_t *newobj);
asl_object_private_t *asl_object_search(asl_object_private_t *obj, asl_object_private_t *query);
asl_object_private_t *asl_object_match(asl_object_private_t *obj, asl_object_private_t *querylist, size_t *last, size_t start, size_t count, uint32_t duration, int32_t dir);
#define ASL_KEY_FREE_NOTE "ASLFreeNotify"
#define ASL_KEY_MESSAGETRACER "com.apple.message.domain"
+#define ASL_KEY_POWERMANAGEMENT "com.apple.iokit.domain"
+#define ASL_KEY_LASTLOG "com.apple.system.lastlog"
+#define ASL_KEY_CFLOG_LOCAL_TIME "CFLog Local Time"
/* remote control bits */
#define EVAL_LEVEL_MASK 0x000000ff
__BEGIN_DECLS
-int asl_store_location() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-char *asl_remote_notify_name() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-int asl_syslog_faciliy_name_to_num(const char *name) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-const char *asl_syslog_faciliy_num_to_name(int n) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int asl_trigger_aslmanager(void) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-int asl_get_filter(asl_object_t client, int *local, int *master, int *remote, int *active) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-uint32_t asl_set_local_control(asl_object_t client, uint32_t filter) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
-uint32_t asl_get_local_control(asl_object_t client) __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
+int asl_store_location() __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+char *asl_remote_notify_name() __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int asl_syslog_faciliy_name_to_num(const char *name) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+const char *asl_syslog_faciliy_num_to_name(int n) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int asl_trigger_aslmanager(void) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+int asl_get_filter(asl_object_t client, int *local, int *master, int *remote, int *active) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_set_local_control(asl_object_t client, uint32_t filter) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.11,10.12), ios(9.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_get_local_control(asl_object_t client) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.11,10.12), ios(9.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
/* EXCLUSIVLY FOR USE BY DEV TOOLS */
/* DO NOT USE THIS INTERFACE OTHERWISE */
-uint32_t asl_store_match_timeout(void *ignored, void *query_v1, void **result_v1, uint64_t *last_id, uint64_t start_id, uint32_t count, int32_t direction, uint32_t usec) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+uint32_t asl_store_match_timeout(void *ignored, void *query_v1, void **result_v1, uint64_t *last_id, uint64_t start_id, uint32_t count, int32_t direction, uint32_t usec) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
__END_DECLS
const asl_jump_table_t *asl_store_jump_table(void);
-uint32_t asl_store_open_write(const char *basedir, asl_store_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_store_open_read(const char *basedir, asl_store_t **s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_store_close(asl_store_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-asl_store_t *asl_store_retain(asl_store_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-void asl_store_release(asl_store_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
-uint32_t asl_store_statistics(asl_store_t *s, asl_msg_t **msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_store_open_write(const char *basedir, asl_store_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_store_open_read(const char *basedir, asl_store_t **s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_store_close(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_store_t *asl_store_retain(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_store_release(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_store_statistics(asl_store_t *s, asl_msg_t **msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_store_set_flags(asl_store_t *s, uint32_t flags) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0);
+uint32_t asl_store_set_flags(asl_store_t *s, uint32_t flags) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.10,10.12), ios(7.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_store_save(asl_store_t *s, asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_store_save(asl_store_t *s, asl_msg_t *msg) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-asl_msg_list_t *asl_store_match(asl_store_t *s, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+asl_msg_list_t *asl_store_match(asl_store_t *s, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_store_match_start(asl_store_t *s, uint64_t start_id, int32_t direction) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_store_match_next(asl_store_t *s, asl_msg_list_t *query, asl_msg_list_t **res, uint32_t count) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
+uint32_t asl_store_match_start(asl_store_t *s, uint64_t start_id, int32_t direction) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_store_match_next(asl_store_t *s, asl_msg_list_t *query, asl_msg_list_t **res, uint32_t count) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_store_max_file_size(asl_store_t *s, size_t max) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-uint32_t asl_store_sweep_file_cache(asl_store_t *s) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2);
+uint32_t asl_store_max_file_size(asl_store_t *s, size_t max) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+uint32_t asl_store_sweep_file_cache(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(3.2,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
-uint32_t asl_store_open_aux(asl_store_t *s, asl_msg_t *msg, int *fd, char **url) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
+uint32_t asl_store_open_aux(asl_store_t *s, asl_msg_t *msg, int *fd, char **url) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.7,10.12), ios(4.3,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
__END_DECLS
char *buf;
} asl_string_t;
-asl_string_t *asl_string_new(uint32_t encoding) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_retain(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-void asl_string_release(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-char *asl_string_release_return_bytes(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-char *asl_string_bytes(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-size_t asl_string_length(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-size_t asl_string_allocated_size(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_append(asl_string_t *str, const char *app) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_append_asl_key(asl_string_t *str, const char *app) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_append_op(asl_string_t *str, uint32_t op) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_append_no_encoding(asl_string_t *str, const char *app) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_append_char_no_encoding(asl_string_t *str, const char c) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
-asl_string_t *asl_string_append_xml_tag(asl_string_t *str, const char *tag, const char *s) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1);
+asl_string_t *asl_string_new(uint32_t encoding) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_retain(asl_string_t *str) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+void asl_string_release(asl_string_t *str) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+char *asl_string_release_return_bytes(asl_string_t *str) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+char *asl_string_bytes(asl_string_t *str) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+size_t asl_string_length(asl_string_t *str) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+size_t asl_string_allocated_size(asl_string_t *str) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_append(asl_string_t *str, const char *app) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_append_asl_key(asl_string_t *str, const char *app) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_append_op(asl_string_t *str, uint32_t op) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_append_no_encoding(asl_string_t *str, const char *app) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_append_char_no_encoding(asl_string_t *str, const char c) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
+asl_string_t *asl_string_append_xml_tag(asl_string_t *str, const char *tag, const char *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.8,10.12), ios(5.1,10.0), watchos(2.0,3.0), tvos(9.0,10.0));
#endif /* __ASL_STRING_H__ */
.Fa "asl_object_t obj"
.Fc
.Sh DESCRIPTION
+.Bf -symbolic
+This interface is obsoleted by
+.Xr os_log 3 .
+.Ef
+.Pp
These routines provide an interface to the Apple System Log facility and to various
data bearing memory objects, files, and storage directories.
.Pp
#include <dispatch/dispatch.h>
#include <libkern/OSAtomic.h>
#include <os/activity.h>
-#include <os/trace.h>
+#include <os/log.h>
#include <os/log_private.h>
#include <asl_ipc.h>
#include <asl_client.h>
*/
#define SIZE_LIMIT_MSG "*** ASL MESSAGE SIZE (%u bytes) EXCEEDED MAXIMIMUM SIZE (%u bytes) ***"
-static const uint8_t shim_asl_to_trace_type[8] = {
- OS_TRACE_TYPE_FAULT, OS_TRACE_TYPE_FAULT, OS_TRACE_TYPE_FAULT, // Emergency, Alert, Critical
- OS_TRACE_TYPE_ERROR, // Error
- OS_TRACE_TYPE_RELEASE, OS_TRACE_TYPE_RELEASE, OS_TRACE_TYPE_RELEASE, // Warning, Notice, Info
- OS_TRACE_TYPE_DEBUG // Debug
+static const os_log_type_t shim_asl_to_log_type[8] = {
+ OS_LOG_TYPE_DEFAULT, // ASL_LEVEL_EMERG
+ OS_LOG_TYPE_DEFAULT, // ASL_LEVEL_ALERT
+ OS_LOG_TYPE_DEFAULT, // ASL_LEVEL_CRIT
+ OS_LOG_TYPE_DEFAULT, // ASL_LEVEL_ERR
+ OS_LOG_TYPE_DEFAULT, // ASL_LEVEL_WARNING
+ OS_LOG_TYPE_DEFAULT, // ASL_LEVEL_NOTICE
+ OS_LOG_TYPE_INFO, // ASL_LEVEL_INFO
+ OS_LOG_TYPE_DEBUG // ASL_LEVEL_DEBUG
};
-
/* forward */
static ASL_STATUS _asl_send_message(asl_object_t obj, uint32_t eval, asl_msg_t *msg, const char *mstring);
+static ASL_STATUS _asl_send_message_text(asl_client_t *asl, asl_msg_t *sendmsg, asl_object_t obj, uint32_t eval, asl_msg_t *msg, const char *mstring, bool shimmed);
__private_extern__ asl_client_t *_asl_open_default();
/* notify SPI */
tunnel = (asl->filter & ASL_FILTER_MASK_TUNNEL) >> 8;
if (tunnel != 0) eval |= EVAL_TUNNEL;
- /* don't send MessageTracer messages to Activity Tracing */
- val = NULL;
- if ((asl_msg_lookup(msg, ASL_KEY_MESSAGETRACER, &val, NULL) == 0) && (val != NULL)) eval &= ~EVAL_SEND_TRACE;
-
if ((asl->options & ASL_OPT_NO_REMOTE) == 0)
{
pthread_mutex_lock(&_asl_global.lock);
if ((filter != 0) && ((filter & lmask) == 0)) eval &= ~EVAL_SEND_ASL;
if (asl->out_count > 0) eval |= EVAL_TEXT_FILE;
+ /* don't send MessageTracer messages to Activity Tracing */
+ val = NULL;
+ if ((asl_msg_lookup(msg, ASL_KEY_MESSAGETRACER, &val, NULL) == 0) && (val != NULL)) eval &= ~EVAL_SEND_TRACE;
+
+ /* don't send PowerManagement messages to Activity Tracing */
+ val = NULL;
+ if ((asl_msg_lookup(msg, ASL_KEY_POWERMANAGEMENT, &val, NULL) == 0) && (val != NULL)) eval &= ~EVAL_SEND_TRACE;
+
+ /* don't send control messages to Activity Tracing */
+ val = NULL;
+ if ((asl_msg_lookup(msg, ASL_KEY_OPTION, &val, NULL) == 0) && (val != NULL)) eval &= ~EVAL_SEND_TRACE;
+
+ /* don't send lastlog/utmp messages to Activity Tracing */
+ val = NULL;
+ if ((asl_msg_lookup(msg, ASL_KEY_FACILITY, &val, NULL) == 0) && (val != NULL) && (!strcmp(val, ASL_KEY_LASTLOG))) eval &= ~EVAL_SEND_TRACE;
+
+ /* don't send CFLog messages to Activity Tracing */
+ val = NULL;
+ if ((asl_msg_lookup(msg, ASL_KEY_CFLOG_LOCAL_TIME, &val, NULL) == 0) && (val != NULL)) eval &= ~EVAL_SEND_TRACE;
+
return eval;
}
+/*
+ * _asl_lib_vlog_text
+ * Internal routine used by asl_vlog.
+ * msg: an asl messsage
+ * eval: log level and send flags for the message
+ * format: A formating string
+ * ap: va_list for the format
+ * returns 0 for success, non-zero for failure
+ */
+
+__private_extern__ ASL_STATUS
+_asl_lib_vlog_text(asl_object_t obj, uint32_t eval, asl_object_t msg, const char *format, va_list ap)
+{
+ int saved_errno = errno;
+ int status;
+ char *str, *fmt, estr[NL_TEXTMAX];
+ uint32_t i, len, elen, expand;
+
+ if (format == NULL) return ASL_STATUS_INVALID_ARG;
+
+ /* insert strerror for %m */
+ len = 0;
+ elen = 0;
+
+ expand = 0;
+ for (i = 0; format[i] != '\0'; i++)
+ {
+ if (format[i] == '%')
+ {
+ if (format[i+1] == '\0') len++;
+ else if (format[i+1] == 'm')
+ {
+ expand = 1;
+ strerror_r(saved_errno, estr, sizeof(estr));
+ elen = strlen(estr);
+ len += elen;
+ i++;
+ }
+ else
+ {
+ len += 2;
+ i++;
+ }
+ }
+ else len++;
+ }
+
+ fmt = (char *)format;
+
+ if (expand != 0)
+ {
+ fmt = malloc(len + 1);
+ if (fmt == NULL) return ASL_STATUS_NO_MEMORY;
+
+ len = 0;
+
+ for (i = 0; format[i] != '\0'; i++)
+ {
+ if (format[i] == '%')
+ {
+ if (format[i+1] == '\0')
+ {
+ }
+ else if ((format[i+1] == 'm') && (elen != 0))
+ {
+ memcpy(fmt+len, estr, elen);
+ len += elen;
+ i++;
+ }
+ else
+ {
+ fmt[len++] = format[i++];
+ fmt[len++] = format[i];
+ }
+ }
+ else fmt[len++] = format[i];
+ }
+
+ fmt[len] = '\0';
+ }
+
+ str = NULL;
+ vasprintf(&str, fmt, ap);
+ if (expand != 0) free(fmt);
+
+ if (str == NULL) return ASL_STATUS_NO_MEMORY;
+
+ status = _asl_send_message_text(NULL, NULL, obj, eval, (asl_msg_t *)msg, str, true);
+ free(str);
+
+ return status;
+}
+
/*
* _asl_lib_vlog
* Internal routine used by asl_vlog.
{
ASL_STATUS status = ASL_STATUS_OK;
uint32_t eval = _asl_evaluate_send(client, msg, level);
+ void *addr = __builtin_return_address(0);
- if (eval & EVAL_SEND_TRACE)
+ if ((eval & EVAL_SEND_TRACE) && os_log_shim_enabled(addr))
{
va_list ap_copy;
if (level < ASL_LEVEL_EMERG) level = ASL_LEVEL_EMERG;
if (level > ASL_LEVEL_DEBUG) level = ASL_LEVEL_DEBUG;
- uint8_t trace_type = shim_asl_to_trace_type[level];
+ os_log_type_t type = shim_asl_to_log_type[level];
va_copy(ap_copy, ap);
- os_log_shim_with_va_list(__builtin_return_address(0), OS_LOG_DEFAULT, trace_type, format, ap_copy, ^(xpc_object_t xdict) {_asl_log_args_to_xpc(client, msg, xdict);} );
+ os_log_with_args(OS_LOG_DEFAULT, type, format, ap_copy, addr);
va_end(ap_copy);
- }
- if (os_log_shim_legacy_logging_enabled() && (eval & EVAL_ASL))
+ if (eval & EVAL_TEXT_FILE)
+ {
+ status = _asl_lib_vlog_text(client, eval, msg, format, ap);
+ }
+ }
+ else if (eval & EVAL_ASL)
{
- asl_msg_t *smsg = asl_msg_new(ASL_TYPE_MSG);
- if (eval & EVAL_SEND_TRACE) asl_msg_set_key_val(smsg, "ASLSHIM", "1");
- smsg = asl_msg_merge(smsg, (asl_msg_t *)msg);
-
- status = _asl_lib_vlog(client, eval, (asl_object_t)smsg, format, ap);
-
- asl_msg_release(smsg);
+ status = _asl_lib_vlog(client, eval, msg, format, ap);
}
return (status == ASL_STATUS_OK) ? 0 : -1;
{
ASL_STATUS status = ASL_STATUS_OK;
uint32_t eval = _asl_evaluate_send(client, msg, level);
+ void *addr = __builtin_return_address(0);
- if (eval & EVAL_SEND_TRACE)
+ if ((eval & EVAL_SEND_TRACE) && os_log_shim_enabled(addr))
{
va_list ap;
if (level < ASL_LEVEL_EMERG) level = ASL_LEVEL_EMERG;
if (level > ASL_LEVEL_DEBUG) level = ASL_LEVEL_DEBUG;
- uint8_t trace_type = shim_asl_to_trace_type[level];
+ os_log_type_t type = shim_asl_to_log_type[level];
va_start(ap, format);
- os_log_shim_with_va_list(__builtin_return_address(0), OS_LOG_DEFAULT, trace_type, format, ap, ^(xpc_object_t xdict) {_asl_log_args_to_xpc(client, msg, xdict);} );
+ os_log_with_args(OS_LOG_DEFAULT, type, format, ap, addr);
va_end(ap);
- }
- if (os_log_shim_legacy_logging_enabled() && (eval & EVAL_ASL))
+ if (eval & EVAL_TEXT_FILE)
+ {
+ va_list ap;
+ va_start(ap, format);
+ status = _asl_lib_vlog_text(client, eval, msg, format, ap);
+ va_end(ap);
+ }
+ }
+ else if (eval & EVAL_ASL)
{
va_list ap;
- asl_msg_t *smsg = asl_msg_new(ASL_TYPE_MSG);
- if (eval & EVAL_SEND_TRACE) asl_msg_set_key_val(smsg, "ASLSHIM", "1");
- smsg = asl_msg_merge(smsg, (asl_msg_t *)msg);
-
va_start(ap, format);
- status = _asl_lib_vlog(client, eval, (asl_object_t)smsg, format, ap);
+ status = _asl_lib_vlog(client, eval, msg, format, ap);
va_end(ap);
-
- asl_msg_release(smsg);
}
return (status == ASL_STATUS_OK) ? 0 : -1;
{
ASL_STATUS status = ASL_STATUS_OK;
uint32_t eval = _asl_evaluate_send(NULL, NULL, level);
+ void *addr = __builtin_return_address(0);
- if (eval & EVAL_SEND_TRACE)
+ if ((eval & EVAL_SEND_TRACE) && os_log_shim_enabled(addr))
{
va_list ap;
if (level < ASL_LEVEL_EMERG) level = ASL_LEVEL_EMERG;
if (level > ASL_LEVEL_DEBUG) level = ASL_LEVEL_DEBUG;
- uint8_t trace_type = shim_asl_to_trace_type[level];
+ os_log_type_t type = shim_asl_to_log_type[level];
va_start(ap, format);
- os_log_shim_with_va_list(__builtin_return_address(0), OS_LOG_DEFAULT, trace_type, format, ap, NULL);
+ os_log_with_args(OS_LOG_DEFAULT, type, format, ap, addr);
va_end(ap);
- }
- if (os_log_shim_legacy_logging_enabled() && (eval & EVAL_ASL))
+ if (eval & EVAL_TEXT_FILE)
+ {
+ va_list ap;
+ va_start(ap, format);
+ status = _asl_lib_vlog_text(NULL, eval, NULL, format, ap);
+ va_end(ap);
+ }
+ }
+ else if (eval & EVAL_ASL)
{
va_list ap;
- asl_msg_t *smsg = asl_msg_new(ASL_TYPE_MSG);
- if (eval & EVAL_SEND_TRACE) asl_msg_set_key_val(smsg, "ASLSHIM", "1");
-
va_start(ap, format);
- status = _asl_lib_vlog(NULL, eval, (asl_object_t)smsg, format, ap);
+ status = _asl_lib_vlog(NULL, eval, NULL, format, ap);
va_end(ap);
-
- asl_msg_release(smsg);
}
return (status == ASL_STATUS_OK) ? 0 : -1;
}
}
+static ASL_STATUS
+_asl_send_message_text(asl_client_t *asl, asl_msg_t *sendmsg, asl_object_t obj, uint32_t eval, asl_msg_t *msg, const char *mstr, bool shimmed)
+{
+ int status;
+ uint32_t level, lmask;
+ asl_msg_t *release_sendmsg = NULL;
+
+ if (asl == NULL) {
+ if (obj == NULL) {
+ asl = _asl_open_default();
+ if (asl == NULL) return ASL_STATUS_FAILED;
+ } else {
+ uint32_t objtype = asl_get_type(obj);
+ if (objtype == ASL_TYPE_CLIENT) asl = (asl_client_t *)obj;
+ }
+ }
+
+ level = eval & EVAL_LEVEL_MASK;
+ if (level > 7) level = 7;
+ lmask = ASL_FILTER_MASK(level);
+
+ if (sendmsg == NULL) {
+ struct timeval tval = {0, 0};
+ const char *sstr, *fstr;
+
+ status = gettimeofday(&tval, NULL);
+ if (status != 0) {
+ time_t tick = time(NULL);
+ tval.tv_sec = tick;
+ tval.tv_usec = 0;
+ }
+
+ sstr = NULL;
+ status = asl_msg_lookup(msg, ASL_KEY_SENDER, &sstr, NULL);
+ if (status != 0) {
+ sstr = NULL;
+ }
+
+ fstr = NULL;
+ status = asl_msg_lookup(msg, ASL_KEY_FACILITY, &fstr, NULL);
+ if (status != 0) {
+ fstr = NULL;
+ }
+ sendmsg = asl_base_msg(asl, level, &tval, sstr, fstr, mstr);
+ if (sendmsg == NULL) {
+ return ASL_STATUS_FAILED;
+ }
+
+ release_sendmsg = sendmsg = asl_msg_merge(sendmsg, msg);
+ }
+
+ /* write to file descriptors */
+ for (uint32_t i = 0; i < asl->out_count; i++) {
+ if (shimmed) {
+ if ((asl->out_list[i].fd != STDOUT_FILENO) && (asl->out_list[i].fd != STDERR_FILENO)) {
+ continue; // new logging only support stdout/stderr
+ }
+ }
+
+ if ((asl->out_list[i].fd >= 0) && (asl->out_list[i].filter != 0) && ((asl->out_list[i].filter & lmask) != 0)) {
+ char *str;
+
+ uint32_t len = 0;
+ str = asl_format_message(sendmsg, asl->out_list[i].mfmt, asl->out_list[i].tfmt, asl->out_list[i].encoding, &len);
+ if (str == NULL) continue;
+
+ status = write(asl->out_list[i].fd, str, len - 1);
+ if (status < 0)
+ {
+ /* soft error for fd 2 (stderr) */
+ if (asl->out_list[i].fd == 2) status = 0;
+ asl->out_list[i].fd = -1;
+ } else {
+ status = 0;
+ }
+
+ free(str);
+ }
+ }
+ if (release_sendmsg) {
+ asl_msg_release(release_sendmsg);
+ }
+
+ return status;
+}
+
static ASL_STATUS
_asl_send_message(asl_object_t obj, uint32_t eval, asl_msg_t *msg, const char *mstr)
{
- uint32_t i, len, level, lmask, outstatus, objtype;
+ uint32_t len, level, lmask, outstatus, objtype;
const char *sstr, *fstr;
struct timeval tval = {0, 0};
int status;
asl_msg_t *qd_msg = NULL;
asl_client_t *asl = NULL;
static dispatch_once_t noquota_once;
+ __block int log_quota_msg = 0;
if ((eval & EVAL_ASL) == 0) return ASL_STATUS_OK;
else
{
const char *qtest = getenv(NOQUOTA_ENV);
- if ((qtest != NULL) && (!strcmp(qtest, "1"))) _asl_global.quota = UINT32_MAX;
+ if ((qtest != NULL) && (!strcmp(qtest, "1")))
+ {
+ _asl_global.quota = UINT32_MAX;
+ log_quota_msg = 1;
+ }
}
/* reset errno since we want stat() to fail silently */
errno = save_errno;
});
+ if (log_quota_msg != 0)
+ {
+ qd_msg = asl_base_msg(asl, QUOTA_LEVEL, &tval, sstr, fstr, QUOTA_DISABLED_MSG);
+ asl_msg_set_key_val(qd_msg, ASL_KEY_OPTION, ASL_OPT_STORE);
+ }
+
if (((eval & EVAL_TUNNEL) == 0) && (_asl_global.quota != UINT32_MAX))
{
time_t last_send = _asl_global.last_send;
len = asl_string_length(send_str);
vmsize = asl_string_allocated_size(send_str);
str = asl_string_release_return_bytes(send_str);
- if (len != 0) kstatus = _asl_server_message(_asl_global.server_port, (caddr_t)str, len);
- if ((str != NULL) && (vmsize != 0)) vm_deallocate(mach_task_self(), (vm_address_t)str, vmsize);
+ if (len != 0)
+ {
+ kstatus = _asl_server_message(_asl_global.server_port, (caddr_t)str, len);
+ if (kstatus != KERN_SUCCESS)
+ {
+ vm_deallocate(mach_task_self(), (vm_address_t)str, vmsize);
+ }
+ }
+ else if (vmsize != 0)
+ {
+ vm_deallocate(mach_task_self(), (vm_address_t)str, vmsize);
+ }
asl_msg_release(qd_msg);
}
if ((sendmsg != NULL) && (asl->out_count > 0))
{
- /* write to file descriptors */
- for (i = 0; i < asl->out_count; i++)
- {
- if ((asl->out_list[i].fd >= 0) && (asl->out_list[i].filter != 0) && ((asl->out_list[i].filter & lmask) != 0))
- {
- char *str;
-
- len = 0;
- str = asl_format_message(sendmsg, asl->out_list[i].mfmt, asl->out_list[i].tfmt, asl->out_list[i].encoding, &len);
- if (str == NULL) continue;
-
- status = write(asl->out_list[i].fd, str, len - 1);
- if (status < 0)
- {
- /* soft error for fd 2 (stderr) */
- if (asl->out_list[i].fd != 2) outstatus = -1;
- asl->out_list[i].fd = -1;
- }
-
- free(str);
- }
- }
+ status = _asl_send_message_text(asl, sendmsg, obj, eval, msg, mstr, false);
}
asl_msg_release(sendmsg);
return outstatus;
}
+static void
+os_log_with_args_wrapper(void *addr, int level, const char *format, ...)
+{
+ va_list ap;
+ if (level < ASL_LEVEL_EMERG) level = ASL_LEVEL_EMERG;
+ if (level > ASL_LEVEL_DEBUG) level = ASL_LEVEL_DEBUG;
+ os_log_type_t type = shim_asl_to_log_type[level];
+
+ va_start(ap, format);
+ os_log_with_args(OS_LOG_DEFAULT, type, format, ap, addr);
+ va_end(ap);
+}
+
/*
* asl_send: send a message
* This routine may be used instead of asl_log() or asl_vlog() if asl_set()
* returns 0 for success, non-zero for failure
*/
__private_extern__ ASL_STATUS
-asl_client_internal_send(asl_object_t obj, asl_object_t msg)
+asl_client_internal_send(asl_object_t obj, asl_object_t msg, void *addr)
{
int status = ASL_STATUS_OK;
uint32_t eval = _asl_evaluate_send(obj, msg, -1);
- if (eval != 0) status = _asl_send_message(obj, eval, (asl_msg_t *)msg, NULL);
+
+ const char *message = asl_msg_get_val_for_key((asl_msg_t *)msg, ASL_KEY_MSG);
+
+ if ((eval & EVAL_SEND_TRACE) && message && message[0] && os_log_shim_enabled(addr))
+ {
+ int level = ASL_LEVEL_DEBUG;
+ const char *lval = asl_msg_get_val_for_key((asl_msg_t *)msg, ASL_KEY_LEVEL);
+ if (lval != NULL) level = atoi(lval);
+
+ /*
+ * If the return address and the format string are from different
+ * binaries, os_log_with_args will not record the return address.
+ * Work around this by passing a dynamic format string.
+ */
+ char dynamic_format[] = "%s";
+ os_log_with_args_wrapper(addr, level, dynamic_format, message);
+
+ if (eval & EVAL_TEXT_FILE)
+ {
+ status = _asl_send_message_text(NULL, NULL, obj, eval, (asl_msg_t *)msg, NULL, true);
+ }
+ }
+ else if (eval & EVAL_ASL)
+ {
+ status = _asl_send_message(obj, eval, (asl_msg_t *)msg, NULL);
+ }
return status;
}
__private_extern__ ASL_STATUS asl_file_open_write_fd(int descriptor, asl_file_t **s);
/* private asl SPI */
-__private_extern__ ASL_STATUS asl_client_internal_send(asl_object_t client, asl_object_t msg);
+__private_extern__ ASL_STATUS asl_client_internal_send(asl_object_t client, asl_object_t msg, void *addr);
#pragma mark -
#pragma mark asl_client_t
ASL_STATUS
asl_client_send(asl_client_t *client, asl_msg_t *msg)
{
- return asl_client_internal_send((asl_object_t)client, (asl_object_t)msg);
+ return asl_client_internal_send((asl_object_t)client, (asl_object_t)msg, __builtin_return_address(0));
}
static asl_msg_list_t *
}
static void
-_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj)
+_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr)
{
int type = asl_get_type((asl_object_t)newobj);
asl_msg_list_reset_iteration((asl_msg_list_t *)newobj, 0);
while (NULL != (msg = asl_msg_list_next((asl_msg_list_t *)newobj)))
{
- if (asl_client_internal_send((asl_object_t)obj, (asl_object_t)msg) != ASL_STATUS_OK) return;
+ if (asl_client_internal_send((asl_object_t)obj, (asl_object_t)msg, addr) != ASL_STATUS_OK) return;
}
}
else if ((type == ASL_TYPE_MSG) || (type == ASL_TYPE_QUERY))
{
- asl_client_internal_send((asl_object_t)obj, (asl_object_t)newobj);
+ asl_client_internal_send((asl_object_t)obj, (asl_object_t)newobj, addr);
}
}
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
- *
+ *
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
- *
+ *
* @APPLE_LICENSE_HEADER_END@
*/
_read_redirect(int descriptor, int flush)
{
int total_read = 0;
- int nbytes;
+ ssize_t nbytes;
asl_redirect_t *aslr = &redirect_descriptors[descriptor];
while ((nbytes = read(descriptor, aslr->w, BUF_SIZE - (aslr->w - aslr->buf) - 1)) > 0)
- {
+ {
char *s, *p;
/* Increment our returned number read */
/* One line at a time */
for (p = aslr->buf; p < aslr->w; p = s + 1)
- {
+ {
/* Find null or \n */
for (s = p; *s && *s != '\n'; s++);
if (*s == '\n') *s='\0';
if (s < aslr->w || aslr->buf == p)
- {
+ {
/* Either the first of multiple messages or one message which is larger than our buffer */
asl_log((aslclient)aslr->asl, (aslmsg)aslr->msg, aslr->level, "%s", p);
}
- else
- {
+ else
+ {
/* We reached the end of the buffer, move this chunk to the start. */
memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf));
aslr->w = aslr->buf + (s - p);
}
if (p == aslr->w)
- {
+ {
/* Start writing at the beginning in the case where we cleared the buffer */
aslr->w = aslr->buf;
}
/* Flush if requested or we're at EOF */
if (flush || nbytes == 0)
- {
+ {
if (aslr->w > aslr->buf)
- {
+ {
*aslr->w = '\0';
asl_log((aslclient)aslr->asl, (aslmsg)aslr->msg, aslr->level, "%s", aslr->buf);
}
read_from_source(void *_source)
{
dispatch_source_t source = (dispatch_source_t)_source;
- int descriptor = dispatch_source_get_handle(source);
+ int descriptor = (int)dispatch_source_get_handle(source);
if (_read_redirect(descriptor, 0) == EOF) dispatch_source_cancel(source);
}
cancel_source(void *_source)
{
dispatch_source_t source = (dispatch_source_t)_source;
- int descriptor = dispatch_source_get_handle(source);
+ int descriptor = (int)dispatch_source_get_handle(source);
asl_redirect_t *aslr = &redirect_descriptors[descriptor];
/* Flush the buffer */
int i;
/* stdout is linebuffered, so flush the buffer */
- if (redirect_descriptors[STDOUT_FILENO].buf) fflush(stdout);
+ if (n_redirect_descriptors > STDOUT_FILENO && redirect_descriptors[STDOUT_FILENO].buf) {
+ fflush(stdout);
+ }
/* Cancel all of our dispatch sources, so they flush to ASL */
for (i = 0; i < n_redirect_descriptors; i++) {
if (descriptor < 0) return EBADF;
if (msg != NULL)
- {
+ {
msg = asl_msg_copy(msg);
if (msg == NULL) return ENOMEM;
}
/* Reallocate if we need more space */
if (descriptor >= n_redirect_descriptors)
- {
+ {
size_t new_n = 1 << (fls(descriptor) + 1);
asl_redirect_t *new_array = realloc(redirect_descriptors, new_n * sizeof(*redirect_descriptors));
if (!new_array)
- {
+ {
err = errno;
return;
}
redirect_descriptors = new_array;
memset(redirect_descriptors + n_redirect_descriptors, 0, (new_n - n_redirect_descriptors) * sizeof(*redirect_descriptors));
- n_redirect_descriptors = new_n;
+ n_redirect_descriptors = (int)new_n;
}
-
+
/* If we're already listening on it, return error. */
if (redirect_descriptors[descriptor].buf != NULL)
- {
+ {
err = EBADF;
return;
}
-
+
/* Initialize our buffer */
redirect_descriptors[descriptor].buf = (char *)malloc(BUF_SIZE);
if (redirect_descriptors[descriptor].buf == NULL)
- {
+ {
err = errno;
return;
}
redirect_descriptors[descriptor].w = redirect_descriptors[descriptor].buf;
-
+
/* Store our ASL settings */
redirect_descriptors[descriptor].level = level;
redirect_descriptors[descriptor].asl = asl_client_retain(asl);
redirect_descriptors[descriptor].msg = msg;
-
+
/* Don't block on reads from this descriptor */
(void)fcntl(descriptor, F_SETFL, O_NONBLOCK);
-
+
/* Start listening */
read_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, descriptor, 0, redirect_serial_q);
redirect_descriptors[descriptor].read_source = read_source;
});
if (err) asl_msg_release(msg);
-
+
return err;
}
/* Create pipe */
if (pipe(pipepair) == -1)
- {
+ {
retval = errno;
errno = oerrno;
return retval;
}
-
+
/* Close the read descriptor but not the write descriptor on exec */
if (fcntl(pipepair[0], F_SETFD, FD_CLOEXEC) == -1)
- {
+ {
retval = errno;
errno = oerrno;
return retval;
/* Replace the existing descriptor */
if (dup2(pipepair[1], descriptor) == -1)
- {
+ {
close(pipepair[0]);
close(pipepair[1]);
retval = errno;
/* If we capture STDOUT_FILENO, make sure we linebuffer stdout */
if (descriptor == STDOUT_FILENO) setlinebuf(stdout);
-
+
/* Close the duplicate descriptors since they've been reassigned */
close(pipepair[1]);
}
static void
-_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj)
+_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr)
{
uint64_t xid;
asl_file_t *s = (asl_file_t *)obj;
}
static void
-_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj)
+_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr)
{
int type = asl_get_type((asl_object_t)newobj);
if ((type != ASL_TYPE_QUERY) && (type != ASL_TYPE_MSG)) return;
}
static void
-_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj)
+_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr)
{
int type = asl_get_type((asl_object_t)newobj);
if ((type != ASL_TYPE_QUERY) && (type != ASL_TYPE_MSG)) return;
}
void
-asl_object_append(asl_object_private_t *obj, asl_object_private_t *newobj)
+asl_object_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr)
{
uint32_t type = ASL_TYPE_CLIENT;
dispatch_once(&asl_object_once, ^{ _asl_object_init(); });
if (asl_jump[type]->append == NULL) return;
- return asl_jump[type]->append(obj, newobj);
+ return asl_jump[type]->append(obj, newobj, addr);
}
void
void
asl_append(asl_object_t a, asl_object_t b)
{
- asl_object_append((asl_object_private_t *)a, (asl_object_private_t *)b);
+ asl_object_append((asl_object_private_t *)a, (asl_object_private_t *)b, __builtin_return_address(0));
}
void
int
asl_send(asl_object_t a, asl_object_t b)
{
- asl_object_append((asl_object_private_t *)a, (asl_object_private_t *)b);
+ asl_object_append((asl_object_private_t *)a, (asl_object_private_t *)b, __builtin_return_address(0));
return 0;
}
}
static void
-_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj)
+_jump_append(asl_object_private_t *obj, asl_object_private_t *newobj, void *addr)
{
asl_store_t *s = (asl_store_t *)obj;
int type = asl_get_type((asl_object_t)newobj);
#include <asl.h>
#include <asl_msg.h>
#include <asl_private.h>
-#include <os/trace.h>
+#include <os/log.h>
#include <os/log_private.h>
#ifdef __STDC__
#define EVAL_ASL (EVAL_SEND_ASL | EVAL_TEXT_FILE | EVAL_ASL_FILE)
-static const uint8_t shim_syslog_to_trace_type[8] = {
- OS_TRACE_TYPE_FAULT, OS_TRACE_TYPE_FAULT, OS_TRACE_TYPE_FAULT, // LOG_EMERG, LOG_ALERT, LOG_CRIT
- OS_TRACE_TYPE_ERROR, // LOG_ERROR
- OS_TRACE_TYPE_RELEASE, OS_TRACE_TYPE_RELEASE, OS_TRACE_TYPE_RELEASE, // LOG_WARN, LOG_NOTICE, LOG_INFO
- OS_TRACE_TYPE_DEBUG // LOG_DEBUG
+static const os_log_type_t shim_syslog_to_log_type[8] = {
+ OS_LOG_TYPE_DEFAULT, // LOG_EMERG
+ OS_LOG_TYPE_DEFAULT, // LOG_ALERT
+ OS_LOG_TYPE_DEFAULT, // LOG_CRIT
+ OS_LOG_TYPE_DEFAULT, // LOG_ERR
+ OS_LOG_TYPE_DEFAULT, // LOG_WARNING
+ OS_LOG_TYPE_DEFAULT, // LOG_NOTICE
+ OS_LOG_TYPE_INFO, // LOG_INFO
+ OS_LOG_TYPE_DEBUG // LOG_DEBUG
};
extern uint32_t _asl_evaluate_send(asl_object_t client, asl_object_t m, int slevel);
extern uint32_t _asl_lib_vlog(asl_object_t obj, uint32_t eval, asl_object_t msg, const char *format, va_list ap);
+extern uint32_t _asl_lib_vlog_text(asl_object_t obj, uint32_t eval, asl_object_t msg, const char *format, va_list ap);
/* SHIM SPI */
vsyslog(int pri, const char *fmt, va_list ap)
{
int level = pri & LOG_PRIMASK;
+ int fac = pri & LOG_FACMASK;
uint32_t eval;
-
+ void *addr;
+
_syslog_asl_client();
eval = _asl_evaluate_send(_sl_asl, NULL, level);
-
- if (eval & EVAL_SEND_TRACE)
+
+ /* don't send install messages to Activity Tracing */
+ if (fac == LOG_INSTALL || (fac == 0 && _sl_fac == LOG_INSTALL)) {
+ eval &= ~EVAL_SEND_TRACE;
+ }
+
+ addr = __builtin_return_address(0);
+
+ if ((eval & EVAL_SEND_TRACE) && os_log_shim_enabled(addr))
{
va_list ap_copy;
- uint8_t trace_type = shim_syslog_to_trace_type[level];
+ os_log_type_t type = shim_syslog_to_log_type[level];
va_copy(ap_copy, ap);
- os_log_shim_with_va_list(__builtin_return_address(0), OS_LOG_DEFAULT, trace_type, fmt, ap_copy, NULL);
+ os_log_with_args(OS_LOG_DEFAULT, type, fmt, ap_copy, addr);
va_end(ap_copy);
+
+ if (eval & EVAL_TEXT_FILE)
+ {
+ asl_object_t msg = asl_new(ASL_TYPE_MSG);
+ const char *facility;
+
+ if (fac != 0)
+ {
+ facility = asl_syslog_faciliy_num_to_name(fac);
+ if (facility != NULL) asl_set(msg, ASL_KEY_FACILITY, facility);
+ }
+
+ _asl_lib_vlog_text(_sl_asl, eval, msg, fmt, ap);
+
+ asl_release(msg);
+ }
}
-
- if (os_log_shim_legacy_logging_enabled() && (eval & EVAL_ASL))
+ else if (eval & EVAL_ASL)
{
asl_object_t msg = asl_new(ASL_TYPE_MSG);
const char *facility;
- int fac = pri & LOG_FACMASK;
-
+
if (fac != 0)
{
facility = asl_syslog_faciliy_num_to_name(fac);
if (facility != NULL) asl_set(msg, ASL_KEY_FACILITY, facility);
}
-
- if (eval & EVAL_SEND_TRACE) asl_set(msg, "ASLSHIM", "2");
-
+
_asl_lib_vlog(_sl_asl, eval, msg, fmt, ap);
-
+
asl_release(msg);
}
}
#endif
{
int level = pri & LOG_PRIMASK;
+ int fac = pri & LOG_FACMASK;
uint32_t eval;
-
+ void *addr;
+
_syslog_asl_client();
eval = _asl_evaluate_send(_sl_asl, NULL, level);
-
- if (eval & EVAL_SEND_TRACE)
+
+ /* don't send install messages to Activity Tracing */
+ if (fac == LOG_INSTALL || (fac == 0 && _sl_fac == LOG_INSTALL)) {
+ eval &= ~EVAL_SEND_TRACE;
+ }
+
+ addr = __builtin_return_address(0);
+
+ if ((eval & EVAL_SEND_TRACE) && os_log_shim_enabled(addr))
{
va_list ap;
- uint8_t trace_type = shim_syslog_to_trace_type[level];
-
+ os_log_type_t type = shim_syslog_to_log_type[level];
+
#ifdef __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
- os_log_shim_with_va_list(__builtin_return_address(0), OS_LOG_DEFAULT, trace_type, fmt, ap, NULL);
+ os_log_with_args(OS_LOG_DEFAULT, type, fmt, ap, addr);
va_end(ap);
+
+ if (eval & EVAL_TEXT_FILE)
+ {
+ va_list ap;
+ asl_object_t msg = asl_new(ASL_TYPE_MSG);
+ const char *facility;
+
+ if (fac != 0)
+ {
+ facility = asl_syslog_faciliy_num_to_name(fac);
+ if (facility != NULL) asl_set(msg, ASL_KEY_FACILITY, facility);
+ }
+
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ _asl_lib_vlog_text(_sl_asl, eval, msg, fmt, ap);
+ va_end(ap);
+
+ asl_release(msg);
+ }
}
-
- if (os_log_shim_legacy_logging_enabled() && (eval & EVAL_ASL))
+ else if (eval & EVAL_ASL)
{
va_list ap;
asl_object_t msg = asl_new(ASL_TYPE_MSG);
const char *facility;
- int fac = pri & LOG_FACMASK;
if (fac != 0)
{
facility = asl_syslog_faciliy_num_to_name(fac);
if (facility != NULL) asl_set(msg, ASL_KEY_FACILITY, facility);
}
-
- if (eval & EVAL_SEND_TRACE) asl_set(msg, "ASLSHIM", "2");
-
+
#ifdef __STDC__
va_start(ap, fmt);
#else
#endif
_asl_lib_vlog(_sl_asl, eval, msg, fmt, ap);
va_end(ap);
-
+
asl_release(msg);
}
}
free(_sl_ident);
_sl_ident = NULL;
+ _sl_fac = 0;
+
pthread_mutex_unlock(&_sl_lock);
}
name = executables;
productName = All;
};
+ 721700891CCABF6F000FC779 /* executables_DaytonaBridge */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 721700921CCABF6F000FC779 /* Build configuration list for PBXAggregateTarget "executables_DaytonaBridge" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 7217008A1CCABF6F000FC779 /* PBXTargetDependency */,
+ 7217008E1CCABF6F000FC779 /* PBXTargetDependency */,
+ 721700901CCABF6F000FC779 /* PBXTargetDependency */,
+ );
+ name = executables_DaytonaBridge;
+ productName = All;
+ };
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
remoteGlobalIDString = 5039177B109140C30001165E;
remoteInfo = syslogd;
};
+ 7217008B1CCABF6F000FC779 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 505ACB9C108FD16400197086;
+ remoteInfo = aslcommon;
+ };
+ 7217008F1CCABF6F000FC779 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 503917C71091413E0001165E;
+ remoteInfo = util;
+ };
+ 721700911CCABF6F000FC779 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 5039177B109140C30001165E;
+ remoteInfo = syslogd;
+ };
FCF3761810D2EED700C0EC8D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
503917C71091413E0001165E /* util */,
5039177B109140C30001165E /* syslogd */,
3F6F43C91613922800CA9ADB /* libsystem_asl */,
+ 721700891CCABF6F000FC779 /* executables_DaytonaBridge */,
);
};
/* End PBXProject section */
target = 5039177B109140C30001165E /* syslogd */;
targetProxy = 503A82131098FB9300B0D08A /* PBXContainerItemProxy */;
};
+ 7217008A1CCABF6F000FC779 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 505ACB9C108FD16400197086 /* aslcommon */;
+ targetProxy = 7217008B1CCABF6F000FC779 /* PBXContainerItemProxy */;
+ };
+ 7217008E1CCABF6F000FC779 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 503917C71091413E0001165E /* util */;
+ targetProxy = 7217008F1CCABF6F000FC779 /* PBXContainerItemProxy */;
+ };
+ 721700901CCABF6F000FC779 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 5039177B109140C30001165E /* syslogd */;
+ targetProxy = 721700911CCABF6F000FC779 /* PBXContainerItemProxy */;
+ };
FCF3761910D2EED700C0EC8D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 505ACB9C108FD16400197086 /* aslcommon */;
baseConfigurationReference = 3F6B6314185AF66C00F692C5 /* util.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = util.tproj/entitlements.plist;
+ CODE_SIGN_ENTITLEMENTS = util.tproj/entitlements.plist;
+ "CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = "";
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
};
name = Release;
};
+ 721700931CCABF6F000FC779 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ 721700921CCABF6F000FC779 /* Build configuration list for PBXAggregateTarget "executables_DaytonaBridge" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 721700931CCABF6F000FC779 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
asl_msg_set_key_val(msg, ASL_KEY_EXPIRE_TIME, buf);
}
- /* Set DB Expire Time for Filesystem errors */
- if (!strcmp(fac, FSLOG_VAL_FACILITY))
- {
- snprintf(buf, sizeof(buf), "%llu", (unsigned long long) tick + FS_TTL_SEC);
- asl_msg_set_key_val(msg, ASL_KEY_EXPIRE_TIME, buf);
- }
-
/*
* special case handling of kernel disaster messages
*/
{
direct_watch[j] = direct_watch[i];
direct_watch_port[j] = direct_watch_port[i];
- j++;
}
+ j++;
}
}
option,
.Nm
prints a usage message.
+.Pp
+NOTE: Most system logs have moved to a new logging system. See
+.Xr log 1
+for more information.
.Ss SENDING MESSAGES
The
.Fl s
.Nm syslog
command completes.
.Sh SEE ALSO
-.Xr syslogd 8 ,
+.Xr log 1 ,
.Xr logger 1 ,
.Xr asl 3 ,
.Xr syslog 3 ,
-.Xr asl.conf 5 .
+.Xr asl.conf 5 ,
+.Xr syslogd 8
.Sh HISTORY
The
.Nm
fprintf(stderr, " %c prefix\n", MOD_PREFIX);
fprintf(stderr, " %c suffix\n", MOD_SUFFIX);
fprintf(stderr, " %c numeric comparison\n", MOD_NUMERIC);
+ fprintf(stderr, "\n");
}
if ((section == HELP_ALL) || (section == HELP_STATS))
fprintf(stderr, " -n n prints stats for just the top n (e.g. top 10) senders\n");
fprintf(stderr, " -d path reads the ASL database at the given path for statistics\n");
fprintf(stderr, " -v verbose ([message_count total_data data_average] for 10 minute intervals)\n");
+ fprintf(stderr, "\n");
}
+
+ fprintf(stderr, "NOTE: Most system logs have moved to a new logging system. See log(1) for more information.\n");
}
const char *
notify_file = -1;
notify_token = -1;
+ fprintf(stderr, "NOTE: Most system logs have moved to a new logging system. See log(1) for more information.\n");
+
/* set starting point */
if (since_boot == 1)
{