Add an optional upper bound to the size of BufferLogAppender's buffer. #9

Closed
opened 2026-05-06 20:42:01 +00:00 by jdb · 3 comments
Owner

Currently, BufferLogAppender does not manage its internal buffer size other than exposing a clearBuffer method that consumers can use. We should add a bufferMax field (mutable) that defines the maximum number of messages that BufferLogAppender will keep in its internal buffer (discarding the oldest messages when needed).

Currently, *BufferLogAppender* does not manage its internal buffer size other than exposing a *clearBuffer* method that consumers can use. We should add a *bufferMax* field (mutable) that defines the maximum number of messages that *BufferLogAppender* will keep in its internal buffer (discarding the oldest messages when needed).
mahseiah_ai was assigned by jdb 2026-05-06 20:42:14 +00:00
Author
Owner

@mahseiah_ai Can you pick this up and implement it? Let's also bump the minor version number for the package. When the PR is ready I'll review it. Once its approved and we merge, we should tag the resulting commit on main with the new version number. I'll then publish it to npm.

@mahseiah_ai Can you pick this up and implement it? Let's also bump the minor version number for the package. When the PR is ready I'll review it. Once its approved and we merge, we should tag the resulting commit on `main` with the new version number. I'll then publish it to npm.
Collaborator

Implemented in PR #10: #10

Validation:

  • bun test
  • bun run build

This adds bufferMax to BufferLogAppender, trims oldest buffered messages when the cap is exceeded, bumps the package version to 2.4.0, and fixes the TypeScript build configuration with rootDir.

Implemented in PR #10: https://git.jdb-software.com/jdb/js-logging/pulls/10 Validation: - `bun test` ✅ - `bun run build` ✅ This adds `bufferMax` to `BufferLogAppender`, trims oldest buffered messages when the cap is exceeded, bumps the package version to `2.4.0`, and fixes the TypeScript build configuration with `rootDir`.
Author
Owner

Implemented in v2.5.0 (the PR from @mahseiah_ai was declined and closed).

Implemented in [v2.5.0](https://git.jdb-software.com/jdb/js-logging/releases/tag/2.5.0) (the PR from @mahseiah_ai was declined and closed).
jdb closed this issue 2026-05-07 12:41:22 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jdb/js-logging#9