# captainqwerty/pslogwriter architecture

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

- Interactive diagram: https://gitdiagram.com/captainqwerty/pslogwriter
- Repository: https://github.com/captainqwerty/pslogwriter

## Overview

PSLogWriter is a small PowerShell logging module. A script imports it, creates a log object, and calls its entry methods; enabled destinations receive the log output. The README documents standard and custom entry types, date formatting, console color, and independently configurable file, console, and system logging. No source excerpts were provided, so implementation responsibilities share the module path and the relationships shown here are limited to those documented in the README.

Main entry points: [`PSLogWriter.psm1`](https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1) (Log Object)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Logging API"]
  node_module["Log Object<br/>[PSLogWriter.psm1]"]
  node_entries["Entry Types &amp; Format<br/>[PSLogWriter.psm1]"]
end

subgraph group_outputs["Log Destinations"]
  node_file["Log File<br/>[PSLogWriter.psm1]"]
  node_console["Console Output<br/>[PSLogWriter.psm1]"]
  node_system["System Logging<br/>[PSLogWriter.psm1]"]
end

node_script(("PowerShell Script"))
node_eventlog["Windows Event Log"]
node_syslog["Linux syslog"]

node_script -->|"creates and calls"| node_module
node_module -->|"accepts entries"| node_entries
node_module -->|"writes optionally"| node_file
node_module -->|"logs optionally"| node_console
node_module -->|"logs optionally"| node_system
node_system -->|"uses on Windows"| node_eventlog
node_system -->|"uses on Linux"| node_syslog

click node_module "https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1"
click node_entries "https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1"
click node_file "https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1"
click node_console "https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1"
click node_system "https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1"

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_module,node_entries toneBlue
class node_file,node_console,node_system toneAmber
class node_script,node_eventlog,node_syslog toneIndigo
```

## Components

### Logging API

- [Log Object](https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1): `PSLogWriter.psm1`
- [Entry Types & Format](https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1): `PSLogWriter.psm1`

### Log Destinations

- [Log File](https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1): `PSLogWriter.psm1`
- [Console Output](https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1): `PSLogWriter.psm1`
- [System Logging](https://github.com/captainqwerty/pslogwriter/blob/main/PSLogWriter.psm1): `PSLogWriter.psm1`

### Other components

- **PowerShell Script**
- **Windows Event Log**
- **Linux syslog**

## Connections

- PowerShell Script → Log Object: creates and calls (evidence: `README.md`)
- Log Object → Entry Types & Format: accepts entries (evidence: `README.md`)
- Log Object → Log File: writes optionally (evidence: `README.md`)
- Log Object → Console Output: logs optionally (evidence: `README.md`)
- Log Object → System Logging: logs optionally (evidence: `README.md`)
- System Logging → Windows Event Log: uses on Windows (evidence: `README.md`)
- System Logging → Linux syslog: uses on Linux (evidence: `README.md`)
