Skip to content

Commit f96164d

Browse files
committed
feat: add API documentation
1 parent 5f2e775 commit f96164d

4 files changed

Lines changed: 67 additions & 9 deletions

File tree

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: website
2+
3+
# build the documentation whenever there are new commits on main
4+
on:
5+
push:
6+
branches:
7+
- main
8+
# Alternative: only build for tags.
9+
# tags:
10+
# - '*'
11+
12+
# security: restrict permissions for CI jobs.
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
# Build the documentation and upload the static HTML files as an artifact.
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
with:
23+
persist-credentials: false
24+
- uses: actions/setup-python@v6
25+
with:
26+
python-version: "3.14"
27+
28+
- run: pip install -e ".[docs]"
29+
- run: pdoc -o docs/ -d="google" vlogs_handler
30+
31+
- uses: actions/upload-pages-artifact@v4
32+
with:
33+
path: docs/
34+
35+
# Deploy the artifact to GitHub pages.
36+
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
37+
deploy:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
permissions:
41+
pages: write
42+
id-token: write
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
steps:
47+
- id: deployment
48+
uses: actions/deploy-pages@v4

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ A Python log handler for VictoriaLogs.
1111
> [!IMPORTANT]
1212
> STATUS: In development. The API is not yet stable.
1313
14+
## Content
15+
16+
- [Description](#description)
17+
- [Features](#features)
18+
- [Installation](#installation)
19+
- [Quick Start](#quick-start)
20+
- [Technical Documentation](#technical-documentation)
21+
- [API documentation](#api-documentation)
22+
1423
## Description
1524

1625
**victorialogs-handler** is a high-performance Python log handler tailored for [VictoriaLogs](https://victoriametrics.com/products/victorialogs/). It integrates seamlessly with Python’s native logging module, allowing you to stream log events to a VictoriaLogs instance with minimal configuration and zero friction.
1726

18-
## Key Features
27+
## Features
1928

2029
- **Asynchronous Processing**: Log events are queued and dispatched in a dedicated background thread, ensuring your application's main execution flow remains non-blocking and highly responsive.
2130

@@ -69,13 +78,13 @@ logger.info("This is an info message")
6978

7079
Please see the directory `/examples` for additional examples on how to use the handler.
7180

72-
## Technical details
81+
## Technical documentation
7382

74-
This section documents technical details of the solution.
83+
This section documents technical aspects of the handler.
7584

76-
### Technical process
85+
### Process Flow
7786

78-
The vlogs handler works as follows:
87+
The process flow of the vlogs handler is as follows:
7988

8089
1. When a a log event is received, it is converted into JSON and stored in the buffer
8190
2. At an interval (e.g. 5 second) or when a threshold is reached (e.g. 125 logs) a background worker starts the process of submitting logs from the buffer to the log server
@@ -111,3 +120,7 @@ VictoriaLogs handles three fields in a special:
111120
- `_stream`: The source of a log event, which is used to group and filter logs. This field is mapped to `stream`.
112121

113122
For more information please also see [VictoriaLogs Data model](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model).
123+
124+
## API documentation
125+
126+
For the documentation of configuration options and defaults please see the [API documentation](https://erikkalkoken.github.io/python-victorialogs-handler/).

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Home = "https://github.com/ErikKalkoken/python-victorialogs-handler"
2929

3030
[project.optional-dependencies]
3131
test = ["coverage"]
32+
docs = ["pdoc"]
3233

3334
[tool.flit.module]
3435
name = "vlogs_handler"

src/vlogs_handler/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@
66
__version__ = "0.1.0dev7"
77

88
__all__ = ["VictoriaLogsHandler"]
9-
10-
# TODO
11-
# - Enable logging and switch to full debug logging in prod for testing
12-
# - Consider using a persistent queue

0 commit comments

Comments
 (0)