Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 159 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ tempfile = "3.10"
parking_lot = "0.12"
log = "0.4"
env_logger = "0.11"
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = ["std", "fmt", "env-filter", "registry", "tracing-log"] }
tracing-appender = "0.2"
tracing-log = "0.2"
xxhash-rust = { version = "0.8", features = ["xxh3"] }

# Diff algorithms
Expand Down
5 changes: 4 additions & 1 deletion atomic-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ thiserror = { workspace = true }

# Logging
log = { workspace = true }
env_logger = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-appender = { workspace = true }
tracing-log = { workspace = true }

# Time
chrono = { workspace = true }
Expand Down
38 changes: 37 additions & 1 deletion atomic-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ atomic push origin
| `-h, --help` | Print help information |
| `-V, --version` | Print version |

## Logging

The terminal shows warnings; `-v` or `RUST_LOG` shows more. Every command also
writes `info` and above to a daily file, `~/.atomic/logs/atomic.YYYY-MM-DD.log`
(UTC date; `logs/` under `ATOMIC_CONFIG_DIR` when that is set), in a directory
only you can read. The last seven files are kept. Each line starts with the
time and process id, then names the command and the spans it ran in:

```
2026-09-28T21:30:23.133637Z pid=4242 INFO ThreadId(01) atomic{cmd=git import}:import{branch="main" commits=50}:write{commits=50}:commit{n=3 of=50 sha=1b9c1fec}: atomic::git::import: write 1b9c1fec …
```

Each span also logs its duration when it closes (`close time.busy=…`).

Besides each crate's own lines, the file carries these targets, which you can
filter on (for example `ATOMIC_LOG=warn,atomic::git::hook=info`):

| Target | What it records |
|--------|-----------------|
| `atomic::logging::command` | Each command's start (version, cwd) and finish (outcome, exit code, error) |
| `atomic::printed` | The ✓/ℹ/⚠/✗ status messages a command printed for you, at their level (file only) |
| `atomic::git::import` | `git import` progress: per-commit parse/write lines, phase timings, decisions |
| `atomic::git::hook` | The evidence each Git hook journaled: checkouts, ref transactions, rewrites, deferred observations |
| `atomic::bridge::event` | Every bridge event the repository's event journal records (reconcile outcomes, refusals, recoveries, binding transfers), as JSON; like the journal, only once the bridge is enabled or from an explicit bridge command |

Git bridge operations run in spans too: `reconcile`, `import_head`, `export`,
`verify`, `switch` (with a line per step reached) and `pre_push`.

| Variable | Effect |
|----------|--------|
| `ATOMIC_LOG` | The file's filter, in `RUST_LOG` syntax (default `warn,atomic=info`); `off` turns the file off |
| `ATOMIC_LOG_DIR` | Write the file to this directory instead; it must be an absolute path |
| `RUST_LOG` | The terminal's filter |

---

## Command Reference
Expand Down Expand Up @@ -862,7 +896,9 @@ Global identity configuration is stored in `~/.config/atomic/` (or platform equi

| Variable | Description |
|----------|-------------|
| `ATOMIC_LOG` | Set log level (`trace`, `debug`, `info`, `warn`, `error`) |
| `ATOMIC_LOG` | The log file's filter, in `RUST_LOG` syntax; `off` turns the file off (see [Logging](#logging)) |
| `ATOMIC_LOG_DIR` | Directory for the log file, an absolute path |
| `RUST_LOG` | The terminal's log filter |
| `NO_COLOR` | Disable colored output (standard convention) |

---
Expand Down
Loading