# pavaram/bash-logger architecture

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

- Interactive diagram: https://gitdiagram.com/pavaram/bash-logger
- Repository: https://github.com/pavaram/bash-logger

## Overview

bash-logger is a reusable Bash logging library. A consuming script sources and initializes it, then sends log messages; the library applies the configured level and output settings, writes to the console and/or log file, and archives old logs. Initialization also registers an exit handler that adds a footer. The README documents these behaviors, but no source excerpts were provided, so the graph shows only documented relationships.

Main entry points: [`lib/logger.sh`](https://github.com/pavaram/bash-logger/blob/main/lib/logger.sh) (Logger library), [`conf/logger.conf`](https://github.com/pavaram/bash-logger/blob/main/conf/logger.conf) (Logger config)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_script(("Bash script"))
node_logger["Logger library<br/>[logger.sh]"]
node_config["Logger config<br/>[logger.conf]"]
node_console["Console"]
node_logfile["Log file"]
node_archive["Log archive"]

node_script -->|"sources and calls"| node_logger
node_config -->|"configures"| node_logger
node_logger -->|"prints logs"| node_console
node_logger -->|"writes logs"| node_logfile
node_logger -->|"archives old logs"| node_archive

click node_logger "https://github.com/pavaram/bash-logger/blob/main/lib/logger.sh"
click node_config "https://github.com/pavaram/bash-logger/blob/main/conf/logger.conf"

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_script,node_console,node_logfile,node_archive toneIndigo
class node_logger,node_config toneTeal
```

## Components

### Other components

- **Bash script**
- [Logger library](https://github.com/pavaram/bash-logger/blob/main/lib/logger.sh): `lib/logger.sh`
- [Logger config](https://github.com/pavaram/bash-logger/blob/main/conf/logger.conf): `conf/logger.conf`
- **Console**
- **Log file**
- **Log archive**

## Connections

- Bash script → Logger library: sources and calls (evidence: `README.md`)
- Logger config → Logger library: configures (evidence: `README.md`)
- Logger library → Console: prints logs (evidence: `README.md`)
- Logger library → Log file: writes logs (evidence: `README.md`)
- Logger library → Log archive: archives old logs (evidence: `README.md`)
