2 * Copyright (c) 2015-2016 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef __os_log_private_h
25 #define __os_log_private_h
28 #include <firehose/tracepoint_private.h>
29 #include <sys/queue.h>
34 * @function os_log_with_args
37 * os_log variant that supports va_list args.
40 * os_log variant that supports va_list args. This SPI should only be used
41 * to shim legacy logging systems through os_log.
44 * Pass OS_LOG_DEFAULT or a log object previously created with os_log_create.
47 * Pass one of the following message types.
55 * A format string to generate a human-readable log message when the log
56 * line is decoded. Supports all standard printf types in addition to %@
57 * and %m (objects and errno respectively).
60 * A va_list containing the values for the format string.
63 * Pass the __builtin_return_address(0) of the function that created the
64 * va_list from variadic arguments. The caller must be the same binary
65 * that generated the message and provided the format string.
67 __OSX_AVAILABLE_STARTING(__MAC_10_12
, __IPHONE_10_0
)
68 OS_EXPORT OS_NOTHROW OS_LOG_NOTAILCALL
70 os_log_with_args(os_log_t oslog
, os_log_type_t type
, const char *format
, va_list args
, void *ret_addr
);
73 * @enum oslog_stream_link_type_t
75 OS_ENUM(oslog_stream_link_type
, uint8_t,
76 oslog_stream_link_type_log
= 0x0,
77 oslog_stream_link_type_metadata
= 0x1,
81 * @typedef oslog_stream_buf_entry_t
83 typedef struct oslog_stream_buf_entry_s
{
84 STAILQ_ENTRY(oslog_stream_buf_entry_s
) buf_entries
;
88 oslog_stream_link_type_t type
;
89 struct firehose_tracepoint_s metadata
[];
90 } *oslog_stream_buf_entry_t
;
94 #endif // __os_log_private_h