# jakewharton/timber architecture

> Architecture diagram of the GitHub repository jakewharton/timber, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jakewharton/timber
- Repository: https://github.com/jakewharton/timber

## Overview

Timber is an extensible Android logging library: an application installs Trees, then sends log calls through Timber’s facade for dispatch and destination-specific handling. On Android, DebugTree infers tags and writes messages to Android Log. The separate lint module registers detectors for common Timber usage and formatting mistakes. The Android implementation and detector excerpts are partial, so the graph omits uncertain internal wiring; lint capabilities are based on the README and registry.

Main entry points: [`timber/src/androidMain/kotlin/timber/log/Timber.kt`](https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt) (Timber facade), [`timber/src/commonMain/kotlin/timber/log/Timber.kt`](https://github.com/jakewharton/timber/blob/trunk/timber/src/commonMain/kotlin/timber/log/Timber.kt) (Custom Tree), [`timber-lint/src/main/java/timber/lint/TimberIssueRegistry.kt`](https://github.com/jakewharton/timber/blob/trunk/timber-lint/src/main/java/timber/lint/TimberIssueRegistry.kt) (Issue registry), [`timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt`](https://github.com/jakewharton/timber/blob/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) (Usage detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_logging["Logging runtime"]
  node_facade["Timber facade<br/>[Timber.kt]"]
  node_tree["Custom Tree<br/>[Timber.kt]"]
  node_debug["DebugTree<br/>[Timber.kt]"]
  node_logprep["Prepare log<br/>[Timber.kt]"]
end

subgraph group_lint["Lint analysis"]
  node_registry["Issue registry"]
  node_detector["Usage detector"]
end

node_app(("Application"))
node_androidlog["Android Log"]
node_lintengine(("Android lint"))

node_app -->|"installs Trees"| node_facade
node_app -->|"sends log calls"| node_facade
node_facade -->|"dispatches calls"| node_tree
node_tree -->|"prepares messages"| node_logprep
node_debug -->|"inherits handling"| node_logprep
node_debug -->|"writes messages"| node_androidlog
node_lintengine -->|"loads issues"| node_registry
node_registry -->|"provides issues"| node_detector

click node_facade "https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt"
click node_tree "https://github.com/jakewharton/timber/blob/trunk/timber/src/commonMain/kotlin/timber/log/Timber.kt"
click node_debug "https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt"
click node_logprep "https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt"
click node_registry "https://github.com/jakewharton/timber/blob/trunk/timber-lint/src/main/java/timber/lint/TimberIssueRegistry.kt"
click node_detector "https://github.com/jakewharton/timber/blob/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_facade,node_tree,node_debug,node_logprep toneBlue
class node_registry,node_detector toneAmber
class node_app,node_androidlog,node_lintengine toneIndigo
```

## Components

### Logging runtime

- [Timber facade](https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt): `timber/src/androidMain/kotlin/timber/log/Timber.kt`
- [Custom Tree](https://github.com/jakewharton/timber/blob/trunk/timber/src/commonMain/kotlin/timber/log/Timber.kt): `timber/src/commonMain/kotlin/timber/log/Timber.kt`
- [DebugTree](https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt): `timber/src/androidMain/kotlin/timber/log/Timber.kt`
- [Prepare log](https://github.com/jakewharton/timber/blob/trunk/timber/src/androidMain/kotlin/timber/log/Timber.kt): `timber/src/androidMain/kotlin/timber/log/Timber.kt`

### Lint analysis

- [Issue registry](https://github.com/jakewharton/timber/blob/trunk/timber-lint/src/main/java/timber/lint/TimberIssueRegistry.kt): `timber-lint/src/main/java/timber/lint/TimberIssueRegistry.kt`
- [Usage detector](https://github.com/jakewharton/timber/blob/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt): `timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt`

### Other components

- **Application**
- **Android Log**
- **Android lint**

## Connections

- Application → Timber facade: installs Trees
- Application → Timber facade: sends log calls
- Timber facade → Custom Tree: dispatches calls
- Custom Tree → Prepare log: prepares messages
- DebugTree → Prepare log: inherits handling
- DebugTree → Android Log: writes messages
- Android lint → Issue registry: loads issues
- Issue registry → Usage detector: provides issues
