Skip to content

🚀 release: v2.3.1#32

Merged
warengonzaga merged 9 commits intomainfrom
dev
Feb 14, 2026
Merged

🚀 release: v2.3.1#32
warengonzaga merged 9 commits intomainfrom
dev

Conversation

@warengonzaga
Copy link
Member

@warengonzaga warengonzaga commented Feb 14, 2026

This pull request adds support for per-call log formatting options, most notably allowing an emoji to be specified or suppressed for individual log messages. This is achieved by introducing a new LogCallOptions parameter to all major logging methods, updating both the logger core and formatter to honor these options, and updating type definitions and documentation accordingly.

Key changes:

Per-call log formatting options

  • Introduced the LogCallOptions type and added it as an optional parameter to all log methods (e.g., debug, info, warn, error, log and their *Raw variants) in both the Logger class and the LogEngine API. This allows callers to override or suppress the emoji used in the log output on a per-message basis. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

Formatter enhancements

  • Updated the MessageFormatter.format method to accept LogCallOptions and use an override emoji if provided, including the ability to suppress the emoji by passing an empty string. [1] [2]

API and documentation updates

  • Extended all relevant JSDoc comments and usage examples to document the new options parameter and demonstrate emoji overrides in practice. [1] [2]
  • Exported the new LogCallOptions type from the package entrypoint for public use.

These changes provide more granular control over log message appearance, making it easier to customize or suppress emojis for specific log entries as needed.

Summary by CodeRabbit

  • New Features

    • Added per-call emoji override capability for logging calls, allowing you to customize or suppress emoji display on individual log statements.
  • Tests

    • Comprehensive test coverage added for emoji override functionality across all logging methods.
  • Chores

    • Version bumped to 2.3.1.
    • Updated project ignore list.

Copilot AI and others added 8 commits February 12, 2026 11:35
* Initial plan

* 📦 new: add bundle size checker with tests and workflow

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: add bundle size checker to documentation

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🧪 test: fix inverted logic in size checker test

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: add permissions block to size-check workflow

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* ⚙️ setup: fix linting issues in size-checker test

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: address PR review feedback

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: improve error handling and validation

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: fix shell injection and improve error visibility

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: fix non-literal require in tests

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
* Initial plan

* 📦 new (emoji): add emoji selector and context-aware logic

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: add comprehensive emoji feature documentation

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: fix linting issues in emoji feature

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update (emoji): address code review feedback

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: enable emoji by default and move toggle to format.includeEmoji

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: update README for new emoji configuration pattern

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: fix trailing spaces in tests

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update (emoji): address code review feedback on performance and state management

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update (emoji): move config to Logger.configure() to preserve regex cache

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: fix eslint errors by removing invalid security rule comments

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: add eslint-disable comments for safe code patterns

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* � test: improve patch coverage for emoji feature

- Remove deprecated dead-code methods (getMappings, matchesKeywords) from EmojiSelector
- Add tests for unknown log level edge case in EmojiSelector
- Add tests for Logger.configure emoji configuration path
- Add tests for numeric and boolean data edge cases

* 🧪 test: improve patch coverage for emoji feature

- Remove deprecated dead-code methods (getMappings, matchesKeywords) from EmojiSelector
- Add tests for unknown log level edge case in EmojiSelector
- Add tests for Logger.configure emoji configuration path
- Add tests for numeric and boolean data edge cases

* 🗑️ remove: delete outdated Snyk security instructions

* 🔧 update: address code review feedback on performance and safety

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Co-authored-by: Waren Gonzaga <opensource@warengonzaga.com>
* Initial plan

* 🔧 update: add LogCallOptions interface and update signatures

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🧪 test: add comprehensive tests for emoji override

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: add options parameter to LogEngine wrapper

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: address code review feedback

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: enhance LogCallOptions JSDoc and add LogEngine wrapper tests

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: replace magic numbers with LogMode enum constants

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
@warengonzaga warengonzaga self-assigned this Feb 14, 2026
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

Good afternoon, sir. This pull request introduces per-call emoji override functionality to the logging system. The implementation adds a new LogCallOptions parameter to all public logging methods, enabling callers to customize emoji display on a per-invocation basis. The feature propagates seamlessly through the logger architecture to the message formatter. A comprehensive test suite validates the new functionality.

Changes

Cohort / File(s) Summary
Configuration
.gitignore, package.json
Adds manual-test.cjs to gitignore; increments package version from 2.3.0 to 2.3.1.
Type Definitions
src/types/index.ts
Introduces LogCallOptions interface with optional emoji field; updates ILogEngine and ILogEngineWithoutRedaction signatures to accept options parameter across all log methods.
Logger Implementation
src/logger/core.ts, src/formatter/message-formatter.ts
Extends Logger methods and MessageFormatter.format() to accept and propagate LogCallOptions; implements emoji override logic with fallback to auto-detection when no override is provided.
Public API Surface
src/index.ts
Updates all public logging methods (debug, info, warn, error, log and raw variants) to accept optional LogCallOptions parameter; exports LogCallOptions type; extends withoutRedaction builder to propagate options through returned methods.
Test Suite
src/__tests__/emoji-override.test.ts
Adds 458 lines of comprehensive test coverage for per-call emoji override across LogFormatter, Logger, raw logging variants, and LogEngine, validating emoji selection logic, message formatting, and data integrity.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Feature: per-call emoji override in log methods #30: This pull request directly implements the per-call emoji override feature requested in this issue, complete with type definitions, method signature updates across all layers, and comprehensive test coverage.

Possibly related PRs

  • 🚀 release: v2.2.0 #21: Both pull requests modify the MessageFormatter.format() signature and Logger method signatures, introducing additional parameters to the same code paths; direct API compatibility consideration required.
  • 🚀 release: v2.3.0 #29: Both pull requests alter the emoji-related options handling in MessageFormatter and public logging method signatures, suggesting potential overlap or sequential implementation.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references a version release (v2.3.1) but the changeset implements per-call emoji override functionality as the primary feature, making the title partially related but not capturing the main technical change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/__tests__/emoji-override.test.ts (1)

26-26: Consider extracting the ANSI-stripping regex into a shared test utility.

The pattern .replace(/\x1b\[[0-9;]*m/g, '') is repeated approximately 30 times across this file. A small helper would reduce noise and ensure consistency.

💡 Optional: Extract a helper
+// At the top of the file or in a shared test utility
+const stripAnsi = (str: string): string => str.replace(/\x1b\[[0-9;]*m/g, '');
+
 // Then in each test:
-const cleanFormatted = formatted.replace(/\x1b\[[0-9;]*m/g, '');
+const cleanFormatted = stripAnsi(formatted);

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@warengonzaga warengonzaga linked an issue Feb 14, 2026 that may be closed by this pull request
@warengonzaga warengonzaga merged commit a43861f into main Feb 14, 2026
17 checks passed
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.

Feature: per-call emoji override in log methods

2 participants