Skip to content

Allow resolve contexts to provide a logger to the resolver - #44

Open
laeubi wants to merge 1 commit into
osgi:mainfrom
laeubi:resolver-logging
Open

laeubi wants to merge 1 commit into
osgi:mainfrom
laeubi:resolver-logging

Conversation

@laeubi

@laeubi laeubi commented Oct 29, 2026

Copy link
Copy Markdown

Moved from osgi/osgi#883, using FormatterLogger as agreed in the discussion.

A resolve operation is a black box: callers only see wires or a ResolutionException.

Changes

  • ResolveContext.getLogger() returns an Optional<FormatterLogger>, empty by default. The resolver may use the logger but is not required to.
  • The spec has a new "Logging" section that covers import ranges: consumer range if only a LoggerFactory is used, provider range if the context supplies its own FormatterLogger.
  • Package version 1.1.1 → 1.2.0, with an org.osgi.service.log 1.4 dependency.
  • The TCK run now includes the 1.2 API bundle and the log API.

No TCK test, because the resolver is not required to log.

Proof of feasibility: apache/felix-dev#585 (stacked on apache/felix-dev#584). A resolver created through the SPI (#43) has no other way to get a logger, because it needs a no-arg constructor.

ResolveContext.getLogger() returns an Optional<FormatterLogger>, empty
by default, so resolve contexts can observe a resolve operation.
FormatterLogger needs no logging framework to implement.

- Document the Logging section and import ranges in the spec
- Bump org.osgi.service.resolver to 1.2.0
- Add org.osgi.service.log to the API and TCK run dependencies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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