feat(logs): device-local log protocol on 1.0.0-rc.1#89
Open
okdistribute wants to merge 4 commits into
Open
Conversation
Ports the device-local file logger and cloud log-level control from iroh-services PR #85 (which was based on the pre-1.0 line) onto the relay-constructor branch / iroh 1.0.0-rc.1: - protocol: add SetLogLevel + FetchLogs to ClientHostProtocol and GetLogLevel to IrohServicesProtocol - caps: add LogsCap (Push / SetLevel / Fetch) - logs: new tracing-subscriber file layer with a cloud-controlled EnvFilter reload handle (LogCollector) - client_host: serve SetLogLevel and stream the current rolling log file for FetchLogs - client: optional log collector with initial GetLogLevel pull after auth - examples/logs.rs All ported APIs compiled unchanged against 1.0.0-rc.1; clippy, fmt, and the logs/fetch_logs tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-services/pr/89/docs/iroh_services/ Last updated: 2026-06-09T23:48:50Z |
cargo make format-check uses unstable rustfmt options (imports_granularity=Crate, group_imports=StdExternalCrate). Reorder the re-export statements in logs.rs to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tracing-appender (rolling file appender) pulls in `symlink`, which doesn't build on wasm32, and the FetchLogs path uses tokio::fs — both native-only. Gate the file-based log collection feature behind cfg(not(target_arch = "wasm32")): - tracing-appender moves to the non-wasm target dependency table - the `logs` module is native-only - ClientBuilder/ClientActor and ClientHost drop their log_collector on wasm - the SetLogLevel / FetchLogs ClientHost handlers respond "not available" on wasm (the protocol variants stay available everywhere) Native build/clippy/tests and the wasm32 --no-default-features build all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The README was a one-line stub. Expand it for newcomers: what the crate is (the client side of the iroh-services cloud hub), the two-way endpoint<->cloud protocol model and capability-gating, a quickstart, and short sections on each feature — metrics, network diagnostics, the new device-local logs, and custom relays — plus an examples table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward-ports the device-local file logger and cloud log-level control from #85 (which was based on the pre-1.0 line) onto the current
1.0.0-rc.1line. Branched offb5/relay-constructorso it carries both the relay-auth preset work and the logs protocol — this is whatn0-computer/svcPR #828 needs to build againstmain(svc moved to iroh-services1.0.0-rc.1, but the logs protocol only existed on the old #85 branch).What's included
SetLogLevel+FetchLogsonClientHostProtocol;GetLogLevelonIrohServicesProtocolLogsCap(Push/SetLevel/Fetch)tracing-subscriberrolling-file layer with a cloud-controlledEnvFilterreload handle (LogCollector); filter starts atoffSetLogLeveland streams the current rolling log file forFetchLogswith_log_collector, pullsGetLogLevelright after authexamples/logs.rsPorting notes
All of #85's ported APIs compiled unchanged against
1.0.0-rc.1— no API migration was needed beyond rebasing the diff.clippy,fmt, and thelogs/fetch_logstests pass.Base / merge order
Targets
b5/relay-constructorto keep the diff to just the logs work. Once relay-constructor lands onmain, this can be retargeted/rebased ontomain, and supersedes #85 on the 1.0 line.🤖 Generated with Claude Code