Skip to content

Conversation

@Gldywn
Copy link
Owner

@Gldywn Gldywn commented Aug 14, 2025

## Description

This PR introduces a flexible logging system to allow users to integrate their own logging solutions and customize log output formats. The previous `LogSink` interface was rigid and did not easily support integration with external loggers, such as the one used by Uptime Kuma.

The new system replaces `LogSink` with a `LogAdapter` function, which accepts a structured `LogObject`. This enables consumers of the library to provide a custom function to process log messages, allowing for seamless integration with any logging framework and full control over the log message format. The `HardenedHttpsValidationKit` now accepts an optional `logAdapter` in its options.

## Related Issue

N/A

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update

## Checklist

- [x] I have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [ ] Any dependent changes have been merged and published in downstream modules.

Open in Cursor Open in Web

Co-authored-by: noe.comte <noe.comte@outlook.fr>
@cursor
Copy link

cursor bot commented Aug 14, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@codecov
Copy link

codecov bot commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/validation-kit.ts 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Gldywn Gldywn closed this Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants