OS_ACTIVITY_MODE ไม่ได้ทำงานสำหรับฉัน (มันอาจจะได้รับเพราะผม typo'd disableเป็นdisabledแต่ไม่ว่าจะเป็นธรรมชาติมากขึ้น?!?) หรืออย่างน้อยก็ไม่ได้ป้องกันการจัดการที่ดีของข้อความ นี่คือข้อตกลงที่แท้จริงเกี่ยวกับตัวแปรสภาพแวดล้อม
https://llvm.org/svn/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb_private::Error
PlatformDarwin::LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) {
  // Starting in Fall 2016 OSes, NSLog messages only get mirrored to stderr
  // if the OS_ACTIVITY_DT_MODE environment variable is set.  (It doesn't
  // require any specific value; rather, it just needs to exist).
  // We will set it here as long as the IDE_DISABLED_OS_ACTIVITY_DT_MODE flag
  // is not set.  Xcode makes use of IDE_DISABLED_OS_ACTIVITY_DT_MODE to tell
  // LLDB *not* to muck with the OS_ACTIVITY_DT_MODE flag when they
  // specifically want it unset.
  const char *disable_env_var = "IDE_DISABLED_OS_ACTIVITY_DT_MODE";
  auto &env_vars = launch_info.GetEnvironmentEntries();
  if (!env_vars.ContainsEnvironmentVariable(disable_env_var)) {
    // We want to make sure that OS_ACTIVITY_DT_MODE is set so that
    // we get os_log and NSLog messages mirrored to the target process
    // stderr.
    if (!env_vars.ContainsEnvironmentVariable("OS_ACTIVITY_DT_MODE"))
      env_vars.AppendArgument(llvm::StringRef("OS_ACTIVITY_DT_MODE=enable"));
  }
  // Let our parent class do the real launching.
  return PlatformPOSIX::LaunchProcess(launch_info);
}
ดังนั้นการตั้งค่าOS_ACTIVITY_DT_MODEเป็น "ไม่" ในตัวแปรสภาพแวดล้อม (วิธี GUI อธิบายไว้ในภาพหน้าจอ Schemes ในคำตอบหลัก) ทำให้มันใช้ได้สำหรับฉัน
เท่าที่NSLogเป็นพื้นดินการทุ่มตลาดสำหรับข้อความระบบข้อผิดพลาดและการแก้จุดบกพร่องของตัวเอง: วิธีการเข้าสู่ระบบที่แท้จริงอาจมีการเรียกร้องให้มีอยู่แล้วเช่นhttps://github.com/fpillet/NSLogger
หรือ
ดื่ม Kool-Aid ใหม่: http://asciiwwdc.com/2016/sessions/721  https://developer.apple.com/videos/play/wwdc2016/721/ 
มันไม่น่าแปลกใจที่มีบางอย่างผิดปกติหลังจากซ่อมบำรุงทั้งหมด API การบันทึก
ภาคผนวก
อย่างไรก็ตามNSLogมันเป็นเพียง shim:
https://developer.apple.com/library/content/releasenotes/Miscellaneous/RN-Foundation-OSX10.12/
  NSLog / CFLog
  
  NSLog ตอนนี้เป็นเพียง shim to os_log ในสถานการณ์ส่วนใหญ่
เพียงทำให้ตอนนี้อ้างแหล่งที่มาสำหรับตัวแปร env อื่น ๆ สถานที่ที่ค่อนข้างแตกต่างกันคราวนี้จาก internals ของ Apple ไม่แน่ใจว่าทำไมมันซ้อนทับกัน [ความคิดเห็นที่ไม่ถูกต้องเกี่ยวกับNSLogการนำออก]
[แก้ไข 22 ก.ย. ]: ฉันสงสัยว่า "ปล่อย" และ "สตรีม" ทำอะไรที่แตกต่างจาก "ดีบั๊ก" แหล่งที่มาไม่เพียงพอ
https://github.com/macosforge/libdispatch/blob/8e63547ea4e5abbfe55c0c3064181c4950a791d3/src/voucher.c
e = getenv("OS_ACTIVITY_MODE");
if (e) {
    if (strcmp(e, "release") == 0) {
        mode = voucher_activity_mode_release;
    } else if (strcmp(e, "debug") == 0) {
        mode = voucher_activity_mode_debug;
    } else if (strcmp(e, "stream") == 0) {
        mode = voucher_activity_mode_stream;
    } else if (strcmp(e, "disable") == 0) {
        mode = voucher_activity_mode_disable;
    }
}