# nickit94/py-logger-in-html architecture

> Architecture diagram of the GitHub repository nickit94/py-logger-in-html, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nickit94/py-logger-in-html
- Repository: https://github.com/nickit94/py-logger-in-html

## Overview

Py-Logger-In-HTML is a Python logging library that routes named log messages either to the console or to a buffered HTML log. The principal file workflow configures logging, collects entries, then saves a styled HTML report at process exit; the report can group entries by module and show levels, timestamps, and formatting. README capabilities include module collapsing, per-entry styles, traceback capture, and optional timestamps. The sampled sources show the logger, shared state, and HTML generator; the tree also includes CSS and JavaScript assets. The asset references in sampled helper constants do not match the listed asset filenames, so no direct asset-loading edge is asserted.

Main entry points: [`logger/logger.py`](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py) (Named logger), [`logger/html_generator.py`](https://github.com/nickit94/py-logger-in-html/blob/main/logger/html_generator.py) (HTML generator), [`logger/logger_helper.py`](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger_helper.py) (Config and buffer), [`logs/Js/script.js`](https://github.com/nickit94/py-logger-in-html/blob/main/logs/Js/script.js) (Module accordion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Logging API"]
  node_config_api["Configuration API<br/>[logger.py]"]
  node_logger_api["Named logger<br/>[logger.py]"]
end

subgraph group_state["Log state"]
  node_config_state["Config and buffer<br/>[logger_helper.py]"]
  node_entry["Log entry<br/>[logger_helper.py]"]
end

subgraph group_output["Report output"]
  node_console["Console output<br/>[logger.py]"]
  node_exit_save["Exit-time saver<br/>[logger.py]"]
  node_html_gen["HTML generator<br/>[html_generator.py]"]
  node_html_report["HTML report"]
end

subgraph group_ui["HTML interface"]
  node_css["Report styling<br/>[style.css]"]
  node_accordion["Module accordion<br/>[script.js]"]
end

node_caller(("Application"))

node_caller -->|"configures"| node_config_api
node_caller -->|"requests logger"| node_logger_api
node_config_api -->|"sets options"| node_config_state
node_logger_api -->|"creates entries"| node_entry
node_logger_api -->|"buffers entries"| node_config_state
node_logger_api -->|"prints directly"| node_console
node_config_state -->|"stores entries"| node_entry
node_exit_save -->|"reads buffer"| node_config_state
node_exit_save -->|"generates report"| node_html_gen
node_html_gen -->|"renders HTML"| node_html_report
node_html_gen -.->|"embeds or links"| node_css
node_html_gen -.->|"embeds or links"| node_accordion
node_caller -->|"saves at exit"| node_exit_save
node_html_report -.->|"supports collapsing"| node_accordion

click node_config_api "https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py"
click node_logger_api "https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py"
click node_config_state "https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger_helper.py"
click node_entry "https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger_helper.py"
click node_console "https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py"
click node_exit_save "https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py"
click node_html_gen "https://github.com/nickit94/py-logger-in-html/blob/main/logger/html_generator.py"
click node_css "https://github.com/nickit94/py-logger-in-html/blob/main/logs/Css/style.css"
click node_accordion "https://github.com/nickit94/py-logger-in-html/blob/main/logs/Js/script.js"

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_config_api,node_logger_api toneBlue
class node_config_state,node_entry toneAmber
class node_console,node_exit_save,node_html_gen,node_html_report toneMint
class node_css,node_accordion toneRose
class node_caller toneIndigo
```

## Components

### Logging API

- [Configuration API](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py): `logger/logger.py`
- [Named logger](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py): `logger/logger.py`

### Log state

- [Config and buffer](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger_helper.py): `logger/logger_helper.py`
- [Log entry](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger_helper.py): `logger/logger_helper.py`

### Report output

- [Console output](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py): `logger/logger.py`
- [Exit-time saver](https://github.com/nickit94/py-logger-in-html/blob/main/logger/logger.py): `logger/logger.py`
- [HTML generator](https://github.com/nickit94/py-logger-in-html/blob/main/logger/html_generator.py): `logger/html_generator.py`
- **HTML report**

### HTML interface

- [Report styling](https://github.com/nickit94/py-logger-in-html/blob/main/logs/Css/style.css): `logs/Css/style.css`
- [Module accordion](https://github.com/nickit94/py-logger-in-html/blob/main/logs/Js/script.js): `logs/Js/script.js`

### Other components

- **Application**

## Connections

- Application → Configuration API: configures (evidence: `README.md`)
- Application → Named logger: requests logger (evidence: `README.md`)
- Configuration API → Config and buffer: sets options (evidence: `logger/logger.py`)
- Named logger → Log entry: creates entries (evidence: `logger/logger.py`)
- Named logger → Config and buffer: buffers entries (evidence: `logger/logger.py`)
- Named logger → Console output: prints directly (evidence: `logger/logger.py`)
- Config and buffer → Log entry: stores entries (evidence: `logger/logger_helper.py`)
- Exit-time saver → Config and buffer: reads buffer (evidence: `logger/logger.py`)
- Exit-time saver → HTML generator: generates report (evidence: `logger/logger.py`)
- HTML generator → HTML report: renders HTML (evidence: `logger/html_generator.py`)
- HTML generator → Report styling: embeds or links
- HTML generator → Module accordion: embeds or links
- Application → Exit-time saver: saves at exit (evidence: `README.md`)
- HTML report → Module accordion: supports collapsing (evidence: `README.md`)
