]>
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
13 #include <os/log_private.h>
15 #define kRtadvdLoggerID "com.apple.rtadvd"
16 static os_log_t rtadvdLogger
= NULL
; /* Handle for Logger */
18 static boolean_t
rtadvd_logger_create(void);
21 rtadvd_logger_create(void)
23 assert(rtadvdLogger
== NULL
);
24 rtadvdLogger
= os_log_create(kRtadvdLoggerID
, "daemon");
26 if (rtadvdLogger
== NULL
) {
27 os_log_error(OS_LOG_DEFAULT
, "Couldn't create os log object");
30 return (rtadvdLogger
!= NULL
);
34 rtadvdLog(int level
, const char *format
, ...)
38 if (rtadvdLogger
== NULL
&& !rtadvd_logger_create()) {
42 va_start(args
, format
);
43 os_log_with_args(rtadvdLogger
, level
, format
, args
, __builtin_return_address(0));