You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何无需设置OS_ACTIVITY_MODE=disable停止控制台持续显示[MC] Invalidating cache

How to Stop [MC] Invalidating Cache Logs Without Disabling OS_ACTIVITY_MODE

Hey there! I’ve fought this annoying [MC] cache invalidation spam more times than I can count, so I totally get why you want a better solution than nuking all OS activity logs with OS_ACTIVITY_MODE=disable. Here are targeted ways to silence just those messages while keeping useful logs intact:

  • Filter logs directly in Xcode
    This is the quickest fix. Head to the Xcode console’s search bar at the bottom, and enter either:

    • NOT [MC] to filter out any log line containing the [MC] tag
    • Or the more precise NOT subsystem:com.apple.metadata (since all those [MC] messages come from Apple’s Metadata subsystem)
      You can even save this filter by clicking the "Save" icon next to the search bar, so you don’t have to retype it every time.
  • Tweak log levels via environment variables
    Instead of disabling all activity logs, adjust the default log stream level to ignore low-priority debug messages:

    1. Open your app’s Scheme editor (Product > Scheme > Edit Scheme)
    2. Go to the Run tab > Arguments > Environment Variables
    3. Add a new variable: OS_LOG_DEFAULT_STREAM_LEVEL and set its value to info or warning
      This will suppress debug-level logs (which those [MC] messages fall under) while keeping info, warning, and error logs visible.
  • Check for problematic dependencies or system updates
    Sometimes these spammy logs are triggered by third-party libraries (especially those handling network requests, caching, or file system operations) that repeatedly interact with Apple’s Metadata framework. Try updating your dependencies to their latest versions—many maintainers fix issues that cause excessive system log calls. You can also try updating to the latest iOS/Xcode version, as Apple occasionally patches overly verbose logging in system frameworks.

  • Programmatically filter logs (advanced)
    If you need even more control, you can use Apple’s OSLog API in your code to configure log filtering. For example, you can explicitly set the log level for the com.apple.metadata subsystem to be ignored, though this requires a bit more setup in your app’s logging configuration.

These approaches let you keep an eye on important system and app logs while getting rid of that endless stream of [MC] invalidation messages—way better than the brute-force OS_ACTIVITY_MODE disable!

内容的提问来源于stack exchange,提问作者kiran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:29:58