]>
git.cameronkatri.com Git - apple_cmds.git/blob - network_cmds/rtadvd.tproj/rtadvd_logging.c
2 * Copyright (c) 2019 Apple Inc. All rights reserved.
4 * This document is the property of Apple Inc.
5 * It is considered confidential and proprietary.
7 * This document may not be reproduced or transmitted in any form,
8 * in whole or in part, without the express written permission of
12 #include <os/log_private.h>
14 #define kRtadvdLoggerID "com.apple.rtadvd"
15 static os_log_t rtadvdLogger
= NULL
; /* Handle for Logger */
17 static boolean_t
rtadvd_logger_create(void);
20 rtadvd_logger_create(void)
22 assert(rtadvdLogger
== NULL
);
23 rtadvdLogger
= os_log_create(kRtadvdLoggerID
, "daemon");
25 if (rtadvdLogger
== NULL
) {
26 os_log_error(OS_LOG_DEFAULT
, "Couldn't create os log object");
29 return (rtadvdLogger
!= NULL
);
33 rtadvdLog(int level
, const char *format
, ...)
37 if (rtadvdLogger
== NULL
&& !rtadvd_logger_create()) {
41 va_start(args
, format
);
42 os_log_with_args(rtadvdLogger
, level
, format
, args
, __builtin_return_address(0));