{"id":195,"date":"2026-03-21T22:47:21","date_gmt":"2026-03-21T14:47:21","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/platforms-mac-logging\/"},"modified":"2026-03-21T23:08:52","modified_gmt":"2026-03-21T15:08:52","slug":"platforms-mac-logging","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/platforms-mac-logging\/","title":{"rendered":"macOS \u65e5\u5fd7"},"content":{"rendered":"<h1>macOS \u65e5\u5fd7<\/h1>\n<h1>\u65e5\u5fd7\uff08macOS\uff09<\/h1>\n<h2>\u6eda\u52a8\u8bca\u65ad\u6587\u4ef6\u65e5\u5fd7\uff08Debug \u9762\u677f\uff09<\/h2>\n<p>OpenClaw \u901a\u8fc7 swift-log\uff08\u9ed8\u8ba4\u4f7f\u7528\u7edf\u4e00\u65e5\u5fd7\uff09\u8def\u7531 macOS \u5e94\u7528\u65e5\u5fd7\uff0c\u5e76\u4e14\u5728\u9700\u8981\u6301\u4e45\u5316\u6355\u83b7\u65f6\u53ef\u4ee5\u5c06\u672c\u5730\u8f6e\u8f6c\u6587\u4ef6\u65e5\u5fd7\u5199\u5165\u78c1\u76d8\u3002<\/p>\n<ul>\n<li>\u8be6\u7ec6\u7ea7\u522b\uff1a<strong>Debug \u9762\u677f \u2192 Logs \u2192 App logging \u2192 Verbosity<\/strong><\/li>\n<li>\u542f\u7528\uff1a<strong>Debug \u9762\u677f \u2192 Logs \u2192 App logging \u2192 &#8220;Write rolling diagnostics log (JSONL)&#8221;<\/strong><\/li>\n<li>\u4f4d\u7f6e\uff1a<code>~\/Library\/Logs\/OpenClaw\/diagnostics.jsonl<\/code>\uff08\u81ea\u52a8\u8f6e\u8f6c\uff1b\u65e7\u6587\u4ef6\u4ee5 <code>.1<\/code>\u3001<code>.2<\/code>\u3001\u2026 \u4e3a\u540e\u7f00\uff09<\/li>\n<li>\u6e05\u9664\uff1a<strong>Debug \u9762\u677f \u2192 Logs \u2192 App logging \u2192 &#8220;Clear&#8221;<\/strong><\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li>\u6b64\u529f\u80fd<strong>\u9ed8\u8ba4\u5173\u95ed<\/strong>\u3002\u4ec5\u5728\u4e3b\u52a8\u8c03\u8bd5\u65f6\u542f\u7528\u3002<\/li>\n<li>\u8be5\u6587\u4ef6\u5305\u542b\u654f\u611f\u4fe1\u606f\uff1b\u5206\u4eab\u524d\u8bf7\u5148\u5ba1\u67e5\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<h2>macOS \u4e0a\u7edf\u4e00\u65e5\u5fd7\u7684\u9690\u79c1\u6570\u636e<\/h2>\n<p>\u7edf\u4e00\u65e5\u5fd7\u4f1a\u5c4f\u853d\u5927\u90e8\u5206\u8d1f\u8f7d\u5185\u5bb9\uff0c\u9664\u975e\u5b50\u7cfb\u7edf\u9009\u62e9\u542f\u7528 <code>privacy -off<\/code>\u3002\u6839\u636e Peter \u5173\u4e8e macOS <a href=\"https:\/\/steipete.me\/posts\/2025\/logging-privacy-shenanigans\">\u65e5\u5fd7\u9690\u79c1\u673a\u5236<\/a>\uff082025\uff09\u7684\u6587\u7ae0\uff0c\u8fd9\u901a\u8fc7 <code>\/Library\/Preferences\/Logging\/Subsystems\/<\/code> \u4e2d\u4ee5\u5b50\u7cfb\u7edf\u540d\u79f0\u4e3a\u952e\u7684 plist \u6587\u4ef6\u6765\u63a7\u5236\u3002\u53ea\u6709\u65b0\u7684\u65e5\u5fd7\u6761\u76ee\u624d\u4f1a\u5e94\u7528\u8be5\u6807\u5fd7\uff0c\u56e0\u6b64\u8bf7\u5728\u590d\u73b0\u95ee\u9898\u4e4b\u524d\u542f\u7528\u5b83\u3002<\/p>\n<h2>\u4e3a OpenClaw \u542f\u7528\uff08<code>bot.molt<\/code>\uff09<\/h2>\n<ul>\n<li>\u5148\u5c06 plist \u5199\u5165\u4e34\u65f6\u6587\u4ef6\uff0c\u7136\u540e\u4ee5 root \u8eab\u4efd\u539f\u5b50\u6027\u5730\u5b89\u88c5\uff1a<\/li>\n<\/ul>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\ncat &lt;&lt;&#8216;EOF&#8217; &gt;\/tmp\/bot.molt.plist<\/p>\n<p>    DEFAULT-OPTIONS<\/p>\n<p>        Enable-Private-Data<\/p>\n<p>EOF<br \/>\nsudo install -m 644 -o root -g wheel \/tmp\/bot.molt.plist \/Library\/Preferences\/Logging\/Subsystems\/bot.molt.plist<br \/>\n&#8220;`<\/p>\n<ul>\n<li>\u65e0\u9700\u91cd\u542f\uff1blogd \u4f1a\u5f88\u5feb\u68c0\u6d4b\u5230\u8be5\u6587\u4ef6\uff0c\u4f46\u53ea\u6709\u65b0\u7684\u65e5\u5fd7\u884c\u624d\u4f1a\u5305\u542b\u9690\u79c1\u8d1f\u8f7d\u3002<\/li>\n<li>\u4f7f\u7528\u73b0\u6709\u7684\u8f85\u52a9\u811a\u672c\u67e5\u770b\u66f4\u4e30\u5bcc\u7684\u8f93\u51fa\uff0c\u4f8b\u5982 <code>.\/scripts\/clawlog.sh --category WebChat --last 5m<\/code>\u3002<\/li>\n<\/ul>\n<h2>\u8c03\u8bd5\u540e\u7981\u7528<\/h2>\n<ul>\n<li>\u79fb\u9664\u8986\u76d6\u914d\u7f6e\uff1a<code>sudo rm \/Library\/Preferences\/Logging\/Subsystems\/bot.molt.plist<\/code>\u3002<\/li>\n<li>\u53ef\u9009\u62e9\u8fd0\u884c <code>sudo log config --reload<\/code> \u5f3a\u5236 logd \u7acb\u5373\u4e22\u5f03\u8986\u76d6\u914d\u7f6e\u3002<\/li>\n<li>\u8bf7\u6ce8\u610f\u6b64\u6570\u636e\u53ef\u80fd\u5305\u542b\u7535\u8bdd\u53f7\u7801\u548c\u6d88\u606f\u6b63\u6587\uff1b\u4ec5\u5728\u786e\u5b9e\u9700\u8981\u989d\u5916\u8be6\u7ec6\u4fe1\u606f\u65f6\u624d\u4fdd\u7559\u8be5 plist \u6587\u4ef6\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>macOS \u65e5\u5fd7 \u65e5\u5fd7\uff08macOS\uff09 \u6eda\u52a8\u8bca\u65ad\u6587\u4ef6\u65e5\u5fd7\uff08Debug \u9762\u677f\uff09 OpenClaw \u901a\u8fc7 swift [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-195","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=195"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":490,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/195\/revisions\/490"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}