Skip to content

feat: add Logger handler config, simplify filter, and add phash2 binding#49

Merged
dbrattli merged 2 commits intomainfrom
feat/logger-handler-config-filter
Mar 29, 2026
Merged

feat: add Logger handler config, simplify filter, and add phash2 binding#49
dbrattli merged 2 commits intomainfrom
feat/logger-handler-config-filter

Conversation

@dbrattli
Copy link
Copy Markdown
Collaborator

@dbrattli dbrattli commented Mar 29, 2026

Summary

  • Add update_handler_config binding for logger:update_handler_config/3 — used to change handler settings like formatter templates
  • Simplify add_primary_filter filter parameter from (System.Func<obj, obj, obj> * obj) to obj — Erlang logger filters are {fun/2, term()} tuples typically constructed via [<Emit>]
  • Add phash2 binding for erlang:phash2/2 — hash a term to a value in [0, Range), useful for partitioning or load balancing

Test plan

  • Verify Logger.update_handler_config(atom "default", atom "formatter", formatterConfig) works on BEAM
  • Verify Logger.add_primary_filter(atom "my_filter", filterTuple) works with Emit-constructed filters
  • Verify phash2 someValue 1000000 returns a consistent hash

🤖 Generated with Claude Code

dbrattli and others added 2 commits March 29, 2026 15:57
…gger

Add update_handler_config/3 binding for changing handler settings like
formatter templates. Simplify add_primary_filter's filter parameter to
obj since Erlang logger filters are {fun/2, term()} tuples typically
constructed via [<Emit>].

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dbrattli dbrattli changed the title feat: add update_handler_config and simplify add_primary_filter feat: add Logger handler config, simplify filter, and add phash2 binding Mar 29, 2026
@dbrattli dbrattli merged commit 6093d4f into main Mar 29, 2026
3 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.

1 participant