Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS issue #13: added libs and content for readthedocs integration #23

Merged
merged 10 commits into from
Nov 25, 2024
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,36 @@
[![Style: Black](https://img.shields.io/badge/Style-Black-008be1.svg)](https://github.com/psf/black)
[![PyPI - Version](https://img.shields.io/pypi/v/logging-http-client?color=ffd343)](https://pypi.org/project/logging-http-client/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/logging-http-client?color=ffd343)](https://pypistats.org/packages/logging-http-client)
[![Docs](https://img.shields.io/badge/ReadTheDocs-6e21d5.svg)](https://logging-http-client.readthedocs.io/en/latest/)

A logging library built on top of the [requests](https://pypi.org/project/requests/) library to provide a familiar
interface for sending HTTP requests with observability features out-of-the-box.

## Table of Contents

- [Background](#background)
- [Usage](#usage)
- [Logging HTTP Client](#logging-http-client)
- [Table of Contents](#table-of-contents)
- [Background](#background)
- [Usage](#usage)
- [1. Drop-in Replacement for requests](#1-drop-in-replacement-for-requests)
- [2. Using the HTTP Client with reusable Sessions](#2-using-the-http-client-with-reusable-sessions)
- [i. Disabling Reusable Sessions For The HTTP Client](#i-disabling-reusable-sessions-for-the-http-client)
- [ii. Adding Shared Headers to the HTTP Client](#ii-adding-shared-headers-to-the-http-client)
- [iii. Setting the client's `x-source`](#iii-setting-the-clients-x-source)
- [iii. `x-request-id` is automatically set](#iii-x-request-id-is-automatically-set)
- [iv. `x-correlation-id` can be automatically set](#iv-x-correlation-id-can-be-automatically-set)
- [i. Disabling Reusable Sessions For The HTTP Client](#i-disabling-reusable-sessions-for-the-http-client)
- [ii. Adding Shared Headers to the HTTP Client](#ii-adding-shared-headers-to-the-http-client)
- [iii. Setting the client's `x-source`](#iii-setting-the-clients-x-source)
- [iii. `x-request-id` is automatically set](#iii-x-request-id-is-automatically-set)
- [iv. `x-correlation-id` can be automatically set](#iv-x-correlation-id-can-be-automatically-set)
- [3. Custom Logging Hooks](#3-custom-logging-hooks)
- [i. Request Logging Hook](#i-request-logging-hook)
- [ii. Response Logging Hook](#ii-response-logging-hook)
- [i. Request Logging Hook](#i-request-logging-hook)
- [ii. Response Logging Hook](#ii-response-logging-hook)
- [4. Default Logging Configurations](#4-default-logging-configurations)
- [i. Disabling Request or Response Logging](#i-disabling-request-or-response-logging)
- [ii. Enabling Request or Response Body Logging](#ii-enabling-request-or-response-body-logging)
- [i. Disabling Request or Response Logging](#i-disabling-request-or-response-logging)
- [ii. Enabling Request or Response Body Logging](#ii-enabling-request-or-response-body-logging)
- [iii. Customizing the logging level](#iii-customizing-the-logging-level)
- [5. Obscuring Sensitive Data](#5-obscuring-sensitive-data)
- [i. Request Log Record Obscurer](#i-request-log-record-obscurer)
- [ii. Response Log Record Obscurer](#ii-response-log-record-obscurer)
- [HTTP Log Record Structure](#http-log-record-structure)
- [Contributing](#contributing)
- [i. Request Log Record Obscurer](#i-request-log-record-obscurer)
- [ii. Response Log Record Obscurer](#ii-response-log-record-obscurer)
- [HTTP Log Record Structure](#http-log-record-structure)
- [Contributing](#contributing)
- [Prerequisites](#prerequisites)
- [Environment Setup](#environment-setup)
- [Code Quality](#code-quality)
Expand Down
19 changes: 19 additions & 0 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_create_environment:
- python -m pip install poetry
post_install:
- cp README.md docs/index.md
- cp CONTRIBUTING.md docs/CONTRIBUTING.md
- cp LICENSE docs/LICENSE.md
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs

mkdocs:
configuration: docs/mkdocs.yml
20 changes: 20 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
site_name: Logging HTTP Client
site_url: https://pypi.org/project/logging-http-client/
repo_url: https://github.com/u-ways/logging-http-client/

docs_dir: ../docs
exclude_docs: |
- .readthedocs.yml
- mkdocs.yml

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.superfences

nav:
- Documentation: index.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md

theme: material
Loading
Loading