Exemplo n.º 1
0
//------------------------------------------------------------------------------
// _IOHIDLog
//------------------------------------------------------------------------------
os_log_t _IOHIDLog(void)
{
    static os_log_t log = NULL;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        log = os_log_create("com.apple.iohid", "default");
    });
Exemplo n.º 2
0
int main(int argc, char** argv)
{
    os_log_t logger_sub1 = os_log_create("org.llvm.lldb.test.sub1", "cat1");
    os_log_t logger_sub2 = os_log_create("org.llvm.lldb.test.sub2", "cat2");
    if (!logger_sub1 || !logger_sub2)
        return 1;

    // Note we cannot use the os_log() line as the breakpoint because, as of
    // the initial writing of this test, we get multiple breakpoints for that
    // line, which confuses the pexpect test logic.
    printf("About to log\n"); // break here
    os_log(logger_sub1, "log message sub%d-cat%d", 1, 1);
    os_log(logger_sub2, "log message sub%d-cat%d", 2, 2);

    // Sleep, as the darwin log reporting doesn't always happen until a bit
    // later.  We need the message to come out before the process terminates.
    sleep(1);

    return 0;
}
Exemplo n.º 3
0
int main(int argc, char** argv)
{
    os_log_t logger_sub1 = os_log_create("org.llvm.lldb.test.sub1", "cat1");
    os_log_t logger_sub2 = os_log_create("org.llvm.lldb.test.sub2", "cat2");
    if (!logger_sub1 || !logger_sub2)
        return 1;

    // Note we cannot use the os_log() line as the breakpoint because, as of
    // the initial writing of this test, we get multiple breakpoints for that
    // line, which confuses the pexpect test logic.
    printf("About to log\n"); // break here
    os_activity_t parent_activity = os_activity_create("parent-activity",
        OS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT);
    os_activity_apply(parent_activity, ^{
        os_log(logger_sub1, "source-log-sub1-cat1");
        os_activity_t child_activity = os_activity_create("child-activity",
            OS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT);
        os_activity_apply(child_activity, ^{
            os_log(logger_sub2, "source-log-sub2-cat2");
            });
        });
Exemplo n.º 4
0
int main(int argc, char** argv)
{
    os_log_t logger = os_log_create("org.llvm.lldb.test", "basic-test");
    if (!logger)
        return 1;

    // Note we cannot use the os_log() line as the breakpoint because, as of
    // the initial writing of this test, we get multiple breakpoints for that
    // line, which confuses the pexpect test logic.
    printf("About to log\n"); // break here
    os_log(logger, "Hello, world");

    // Sleep, as the darwin log reporting doesn't always happen until a bit
    // later.  We need the message to come out before the process terminates.
    sleep(FINAL_WAIT_SECONDS);

    return 0;
}