# EPF Cohort 6 – Week 8 Update
## Progress This Week
Following feedback from [Tumas](https://github.com/Tumas) (Grandine), I enhanced the [**Phase 1 PR**](https://github.com/sntntn/grandine/pull/1) by adding TTY-based ANSI style detection and restoring the `logger-always-write-style` feature.
Tumas pointed out that the option for users to customize whether logs include color/style should remain available — especially important when redirecting output to files, where colored output can cause issues.
To address this, I implemented automatic detection of whether the output is going to a terminal (**TTY**). If so, colored tracing output is enabled; otherwise, plain output is used by default, preserving the option for users to explicitly control log styling.
---
After that, I started **Phase 2** from the [roadmap](https://hackmd.io/JX5Q0ObtQ-iStLwSmVRPVg#Phase-1-Foundational-Setup).
First, I worked on the full replacement of legacy logging macros across the codebase with tracing-based helpers [**issue** *"Introduce tracing globally & Replace classic info!, warn!, debug!, error!, trace! macros with PEER_LOG_METRICS-aware helper macros"*](https://github.com/sntntn/grandine/issues/7)
since showing connected_peer_count / target_peer_count is necessary information for the Grandine client.
Additionally, I started working on [**issue** – *"Instrument network layer with tracing"*](https://github.com/sntntn/grandine/issues/2) in **http_api** crate by:
- Adding `tracing::instrument` spans to main HTTP tasks and critical endpoints for better observability.
- Instrumenting public endpoints such as block publishing, validator block requests, and attestation submissions.
- Introducing internal spans in important block and attestation processing functions.
## Next Steps
- Eliminate `slog-stdlog` bridge and make a **coordinated change** in the `eth2_libp2p` submodule ([**issue** detalils here](https://github.com/sntntn/grandine/issues/8))
- Expand tracing instrumentation on the networking layer to cover more critical paths (next targes: [eth2_libp2p](https://github.com/grandinetech/eth2_libp2p) & [p2p](https://github.com/grandinetech/grandine/tree/develop/p2p)).
- Carefully backport tracing-related changes from Lighthouse’s networking layer, since Grandine uses a part of Lighthouse’s [networking layer](https://github.com/sigp/lighthouse/tree/stable/beacon_node/lighthouse_network).
## Resources
- [Grandine GitHub Repository](https://github.com/grandinetech/grandine)
- [Lighthouse_network](https://github.com/sigp/lighthouse/tree/stable/beacon_node/lighthouse_network) extracted as [eth2_libp2p](https://github.com/grandinetech/eth2_libp2p).
- [Roadmap HackMD](https://hackmd.io/JX5Q0ObtQ-iStLwSmVRPVg)
- [Phase 1 PR – enhanced with ANSI style detection](https://github.com/sntntn/grandine/pull/1)