# aaronzhouciph/ulog architecture

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

- Interactive diagram: https://gitdiagram.com/aaronzhouciph/ulog
- Repository: https://github.com/aaronzhouciph/ulog

## Overview

uLog is a small embedded C logging library. Applications initialize it, register callbacks with severity thresholds, and submit formatted messages; uLog filters and formats each message before dispatching it to eligible callbacks. The README also describes console, file, and memory-buffer outputs as user-provided callbacks, not built-in sinks. The runtime source is sampled; these documented integrations remain external to the repository.

Main entry points: [`src/ulog.h`](https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.h) (Public API), [`src/ulog.c`](https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.c) (Format and Dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Logging API"]
  node_api["Public API<br/>[ulog.h]"]
end

subgraph group_runtime["Logging Runtime"]
  node_management["Subscriber Management<br/>[ulog.c]"]
  node_format["Format and Dispatch<br/>[ulog.c]"]
end

node_application(("Application"))
node_callback["User Callback"]
node_console["Console Output"]
node_file["File Output"]
node_buffer["Memory Buffer"]

node_application -->|"logs and configures"| node_api
node_api -->|"calls management"| node_management
node_api -->|"calls logging"| node_format
node_management -->|"sets dispatch thresholds"| node_format
node_format -->|"dispatches message"| node_callback
node_callback -.->|"may write to"| node_console
node_callback -.->|"may write to"| node_file
node_callback -.->|"may write to"| node_buffer

click node_api "https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.h"
click node_management "https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.c"
click node_format "https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.c"

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_api,node_callback toneBlue
class node_management,node_format toneAmber
class node_application,node_console,node_file,node_buffer toneIndigo
```

## Components

### Logging API

- [Public API](https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.h): `src/ulog.h`

### Logging Runtime

- [Subscriber Management](https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.c): `src/ulog.c`
- [Format and Dispatch](https://github.com/aaronzhouciph/ulog/blob/master/src/ulog.c): `src/ulog.c`

### Other components

- **Application**
- **User Callback**
- **Console Output**
- **File Output**
- **Memory Buffer**

## Connections

- Application → Public API: logs and configures (evidence: `README.md`)
- Public API → Subscriber Management: calls management (evidence: `src/ulog.h`)
- Public API → Format and Dispatch: calls logging (evidence: `src/ulog.h`)
- Subscriber Management → Format and Dispatch: sets dispatch thresholds (evidence: `src/ulog.c`)
- Format and Dispatch → User Callback: dispatches message (evidence: `src/ulog.c`)
- User Callback → Console Output: may write to (evidence: `README.md`)
- User Callback → File Output: may write to (evidence: `README.md`)
- User Callback → Memory Buffer: may write to (evidence: `README.md`)
