usage

usage 0.29.32

工具與目錄
在這頁

新功能 3 項

01

遮蔽專案名稱全面生效,圖表與匯出檔案不洩密

「遮蔽專案名稱」現在會套用至整份匯出 usage 報表,分享時不再只是把名稱藏在畫面上。過去匯出的 HTML 報表雖然在畫面上隱藏了專案名稱,檔案內部卻仍夾帶未遮蔽的資料集,等於只在螢幕遮住卻沒從檔案拿掉;現在未遮蔽的副本已自匯出檔完全移除。過去圓餅圖圖例與專案名稱深入分析都仍顯示真實專案名稱;現在兩者也一併納入遮蔽,分析文字改為 Project N,對齊專案表格既有的編號。⟦這像拿黑筆塗黑公文上的機密名稱,以前只塗了複寫紙表面、底層仍夾著原稿;現在則在寄出前把原始底稿徹底抽除。⟧若你曾分享過舊版產生的遮蔽報表,請將那些檔案視為未遮蔽處理。

官方原文

**The "mask project names" option now applies to the entire shared file.** An exported HTML report previously still carried the unmasked dataset alongside the masked one, so masking hid the names on screen without removing them from the file. The unmasked copy is now dropped from the export. If you shared a masked report from an earlier version, treat those files as unmasked.

**The donut legend and project-naming insights are covered by the mask as well.** Both previously kept showing real project names; insights now read Project N, matching the numbering already used by the project table.

02

本機檔案限擁有者,隔離目錄明確設定存取模式

⟦在共用辦公室存放私人物品,不只要把置物箱上鎖,放箱子的儲藏室大門也得加鎖,同棟樓的其他帳號才翻看不到內容。⟧ usage 現在為本機建立的檔案與目錄全面套用僅限擁有者的存取權限。以往存放在 ~/.usage/、~/.usage-reports/ 與 ~/Library/Logs/usage/ 底下的附件、匯出報表與紀錄檔,權限曾允許同部電腦的其他本機帳號讀取;現在新建立的檔案權限一律設為 0600,所屬目錄則設為 0700。匯入附件時也不再複製來源檔案原有的權限。此外,過去移入隔離目錄的檔案雖保有擁有者權限,但目錄本身並未限制;現在該隔離目錄在建立時也會設定明確的存取模式。

官方原文

**Local files are created with owner-only permissions.** Attachments, exported reports and logs under ~/.usage/, ~/.usage-reports/ and ~/Library/Logs/usage/ were created with permissions that allowed other local accounts on the same machine to read them. New files are now 0600 and their directories 0700. Attachment import no longer copies the source file's permissions along with the file.

**The quarantine directory is created with an explicit mode.** Files moved into it already kept owner-only permissions; the directory itself did not.

03

超長行設上限,深層巢狀改列無效行

JSONL(每行各放一筆 JSON 資料的檔案格式)歷史檔案中的異常大行,不再會耗盡記憶體、拖垮整個讀取流程。usage 現在以 64 MiB 為上限來讀取每行資料,這個數值是根據實測真實環境中 23 MB 的最大記錄所設定;一旦單行資料超過此上限,程式會直接略過它並繼續運作。遇到層層巢狀過深而引發遞迴錯誤(RecursionError)的 JSON 內容,也會直接當成無效行處理。⟦這像包裹分揀線入口設了兩道檢查:尺寸過大的貨物,以及包裝層數深到難以檢查的貨物,都直接撥到旁道,讓其他包裹繼續前進。⟧這能防止超過 64 MiB 或因巢狀過深引發 RecursionError 的歷史資料中斷讀取流程。

官方原文

**An oversized line in a JSONL history file no longer exhausts memory.** Lines are read against a 64 MiB ceiling, set from a measured 23 MB real-world maximum, and skipped cleanly when they exceed it. Deeply nested JSON that raises RecursionError is treated as an invalid line.