-/* String to append as format modifier for each key-value pair */
-#define FSLOG_KEYVAL_FMT "[%s %s] "
-#define FSLOG_KEYVAL_FMT_LEN (sizeof(FSLOG_KEYVAL_FMT) - 1)
-
-#define FSLOG_NEWLINE_CHAR "\n"
-#define FSLOG_NEWLINE_CHAR_LEN (sizeof(FSLOG_NEWLINE_CHAR) - 1)
-
-/* Length of entire ASL message in 10 characters. Kernel defaults to zero */
-#define FSLOG_ASL_MSG_LEN " 0"
-
-/* Length of default format string to be used by printf */
-#define MAX_FMT_LEN 256
-
-/* Internal function to print input values as key-value pairs in format
- * identifiable by Apple system log (ASL) facility. All key-value pairs
- * are assumed to be pointer to strings and are provided using two ways -
- * (a) va_list argument which is a list of varying number of arguments
- * created by the caller of this function.
- * (b) variable number of arguments passed to this function.
- *
- * Parameters -
- * level - Priority level for this ASL message
- * facility - Facility for this ASL message.
- * num_pairs - Number of key-value pairs provided by vargs argument.
- * vargs - List of key-value pairs.
- * ... - Additional key-value pairs (apart from vargs) as variable
- * argument list. A NULL value indicates the end of the
- * variable argument list.
- *
- * Returns -
- * zero - On success, when it prints all key-values pairs provided.
- * E2BIG - When it cannot print all key-value pairs provided and had
- * to truncate the output.
- */
-static int fslog_asl_msg(int level, const char *facility, int num_pairs, va_list vargs, ...)
-{
- int err = 0;
- char fmt[MAX_FMT_LEN]; /* Format string to use with vaddlog */
- int calc_pairs = 0;
- size_t len;
- int i;
- va_list ap;
- char *ptr;
-
- /* Mask extra bits, if any, from priority level */
- level = LOG_PRI(level);
-
- /* Create the first part of format string consisting of ASL
- * message length, level, and facility.
- */
- if (facility) {
- snprintf(fmt, MAX_FMT_LEN, "%s [%s %d] [%s %d] [%s %s] ",
- FSLOG_ASL_MSG_LEN,
- FSLOG_KEY_LEVEL, level,
- FSLOG_KEY_READ_UID, FSLOG_VAL_READ_UID,
- FSLOG_KEY_FACILITY, facility);
- } else {
- snprintf(fmt, MAX_FMT_LEN, "%s [%s %d] [%s %d] ",
- FSLOG_ASL_MSG_LEN,
- FSLOG_KEY_LEVEL, level,
- FSLOG_KEY_READ_UID, FSLOG_VAL_READ_UID);
- }