1 #include <os/log.h>
2 #include <stdio.h>
3
4 #include "../../common/darwin_log_common.h"
5
main(int argc,char ** argv)6 int main(int argc, char** argv)
7 {
8 os_log_t logger_sub1 = os_log_create("org.llvm.lldb.test.sub1", "cat1");
9 os_log_t logger_sub2 = os_log_create("org.llvm.lldb.test.sub2", "cat2");
10 if (!logger_sub1 || !logger_sub2)
11 return 1;
12
13 // Note we cannot use the os_log() line as the breakpoint because, as of
14 // the initial writing of this test, we get multiple breakpoints for that
15 // line, which confuses the pexpect test logic.
16 printf("About to log\n"); // break here
17 os_log_debug(logger_sub1, "source-log-sub1-cat1");
18 os_log(logger_sub2, "source-log-sub2-cat2");
19
20 // Sleep, as the darwin log reporting doesn't always happen until a bit
21 // later. We need the message to come out before the process terminates.
22 sleep(FINAL_WAIT_SECONDS);
23
24 return 0;
25 }
26