Skip to content

Commit dd3abb5

Browse files
committed
[formats] update fsck_log
1 parent 9da2c85 commit dd3abb5

5 files changed

Lines changed: 70 additions & 25 deletions

File tree

NEWS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ Features:
1010
The `z`/`Z` keys can also be used to increase/decrease the
1111
context by one in the LOG, TEXT, and TIMELINE views. Context
1212
lines are styled using the new `context-line` theme style.
13+
* Added a log format for the `fsck_apfs` and `fsck_hfs` tools on
14+
macOS, covering both the `started`/`completed` lifecycle lines
15+
and legacy `run` entries. This replaces the previous
16+
`fsck_hfs_log` format, which only matched the start lines.
17+
The new format exposes `device`, `tool`, and `action` fields,
18+
groups messages by device in the TIMELINE view, and highlights
19+
`error:` lines and `FILESYSTEM CLEAN` status messages.
20+
21+
Breaking changes:
22+
* File-size values can now be written with the IEC binary
23+
prefixes (`KiB`, `MiB`, `GiB`, ...) for 1024-based units.
24+
The existing `KB`/`MB`/... forms now follow the strict SI
25+
convention (1000-based), so scripts that depended on the
26+
informal 1024 meaning for SI prefixes should be updated to
27+
use the `i` suffix. The `humanize::file_size()` formatter
28+
likewise emits SI-based `KB`/`MB`/... output.
1329

1430
## lnav v0.14.0
1531

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ set(FORMAT_FILES
200200
formats/engine_log.json
201201
formats/error_log.json
202202
formats/esx_syslog_log.json
203-
formats/fsck_hfs_log.json
203+
formats/fsck_log.json
204204
formats/github_events_log.json
205205
formats/glog_log.json
206206
formats/haproxy_log.json

src/formats/formats.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FORMAT_FILES = \
1717
$(srcdir)/%reldir%/env_logger_log.json \
1818
$(srcdir)/%reldir%/error_log.json \
1919
$(srcdir)/%reldir%/esx_syslog_log.json \
20-
$(srcdir)/%reldir%/fsck_hfs_log.json \
20+
$(srcdir)/%reldir%/fsck_log.json \
2121
$(srcdir)/%reldir%/github_events_log.json \
2222
$(srcdir)/%reldir%/glog_log.json \
2323
$(srcdir)/%reldir%/haproxy_log.json \

src/formats/fsck_hfs_log.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/formats/fsck_log.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
3+
"fsck_log": {
4+
"title": "Fsck Log",
5+
"description": "Log format for the fsck_apfs and fsck_hfs tools on Mac OS X.",
6+
"regex": {
7+
"std": {
8+
"pattern": "^(?<device>[^:]+): (?<tool>fsck_apfs|fsck_hfs) (?<action>run|started|completed) at (?<timestamp>\\S{3,8} \\S{3,8}\\s+\\d{1,2} \\d{2}:\\d{2}:\\d{2} \\d{4})(?<body>.*)"
9+
}
10+
},
11+
"opid-field": "device",
12+
"value": {
13+
"device": {
14+
"kind": "string",
15+
"identifier": true
16+
},
17+
"tool": {
18+
"kind": "string",
19+
"identifier": true
20+
},
21+
"action": {
22+
"kind": "string",
23+
"identifier": true
24+
}
25+
},
26+
"highlights": {
27+
"error": {
28+
"pattern": "\\berror:.*",
29+
"color": "#ef5350",
30+
"underline": false
31+
},
32+
"clean": {
33+
"pattern": "\\bFILESYSTEM CLEAN\\b",
34+
"color": "#22da6e"
35+
}
36+
},
37+
"sample": [
38+
{
39+
"line": "/dev/rdisk0s2: fsck_hfs run at Wed Jul 25 23:01:18 2012"
40+
},
41+
{
42+
"line": "/dev/rdisk2s1: fsck_apfs started at Tue Mar 3 17:38:59 2026"
43+
},
44+
{
45+
"line": "/dev/rdisk2s1: fsck_apfs completed at Tue Mar 3 17:38:59 2026"
46+
},
47+
{
48+
"line": "/dev/rdisk4s1: fsck_hfs completed at Wed Mar 4 08:03:33 2026"
49+
}
50+
]
51+
}
52+
}

0 commit comments

Comments
 (0)