Skip to content

feat(logging): pluggable custom logger support#73

Merged
rederik76 merged 13 commits into
mainfrom
feature/pluggable-logger
May 19, 2026
Merged

feat(logging): pluggable custom logger support#73
rederik76 merged 13 commits into
mainfrom
feature/pluggable-logger

Conversation

@rederik76

Copy link
Copy Markdown
Collaborator

Replaces the hardcoded utility.set_logger() call with a merge-driven resolution
pipeline that supports optional custom loggers configured via logger.json in both
the framework bundle (config/override/) and the pipeline bundle (pipeline_configs/).
Core changes:

  • src/logger.py: new module — create_default_logger, load/merge logger.json,
    resolve_logger, CompositeLogger (custom primary + stdout mirror), and the
    top-level resolve_pipeline_logger entry point
  • src/config/default/logger.json: shipped default (enabled: false)
  • src/dlt_pipeline_builder.py: wire resolve_pipeline_logger; call
    register_bundle_sys_paths() before logger init so src/local/libraries/
    modules are importable when the factory is loaded
  • src/bundle_loader.py: make logger optional to break the init chicken-and-egg
  • src/utility.py: convert debug print() calls to logger.debug(); add optional
    logger param to get_data_from_files_parallel
  • tests/test_logger.py: unit tests for merge, resolve, and CompositeLogger
  • docs/source/feature_logging.rst: full rewrite; includes custom logger contract
    and step-by-step structured JSON logger example

rederik76 added 6 commits April 17, 2026 17:14
Introduce pre_init and post_init hook folders executed via runpy around
initialize_pipeline(), with extensions/libraries on sys.path and legacy
flat extensions/ deprecated.
- Add extension_loader (add_extensions_libraries_to_sys_path, run_init_hooks)
- Extend constants for libraries/pre_init/post_init paths; resolve python
  function files under extensions/libraries before legacy extensions/
- Wire hooks in DLTPipelineBuilder; bump version; add unit tests
- Update docs, scaffold, samples (bronze), Cursor assets/SKILL, VERSION
…tensions/

Replaces the single-directory extensions/ convention with a structured src/ layout
that separates cluster libraries, spec-referenced Python, and lifecycle init scripts.
Renames extension_loader.py to bundle_loader.py to reflect its broader role.

Layout changes
- Pipeline bundles: src/libraries/ (wheels + sys.path), src/python/ (spec Python),
  src/init/pre/ and src/init/post/ (lifecycle scripts)
- Framework bundle: custom code lives exclusively under src/local/ (libraries/,
  python/, init/pre/, init/post/) — no top-level src/ equivalents
- FrameworkPaths constants renamed to LOCAL_* to reflect local/ prefix; all
  *sourcePath confs resolve to src/ so constants omit the src/ segment

Deprecation
- extensions/ on sys.path deprecated (v0.13.0), removed in v1.0.0
- extensions/ is registered unconditionally alongside src/python/ when both exist
- extensions/libraries/ (never shipped) dropped with no deprecation window

Code
- extension_loader.py → bundle_loader.py; uses FrameworkPaths.LOCAL_* for
  framework paths and PipelineBundlePaths.* for bundle paths
- dataflow_spec_builder: search paths updated to LOCAL_* framework constants
- constants.py: FrameworkPaths gains LOCAL_* paths; PipelineBundlePaths paths
  corrected to omit redundant src/ prefix

Samples & template
- bronze_sample migrated: extensions/libraries/ → src/python/,
  extensions/pre_init|post_init/ → src/init/pre|post/
- New libraries demo: phonenumbers wheel in src/libraries/, installed via
  environment.dependencies; demonstrates full install→import chain
- pipeline_bundle_template scaffolded with README.md for each new src/ directory
- src/local/ scaffolded in framework src/ with README.md files

Docs & ADRs
- feature_python_extensions.rst rewritten: new title, bundle context table,
  src/python/ replaces src/extensions/ throughout, environment.dependencies
  replaces libraries: whl/pypi syntax
- feature_python_functions.rst, feature_python_source.rst: updated to src/python/
  with deprecation notices for src/extensions/
- build_pipeline_bundle_steps.rst, build_pipeline_bundle_structure.rst: updated
  directory diagrams and added steps for libraries/python/init
- docs/decisions/0001-bundle-src-layout.md, 0002-extensions-deprecation.md: new ADRs
…tdout example

Replaces the hardcoded utility.set_logger() call with a merge-driven resolution
pipeline that supports optional custom loggers configured via logger.json in both
the framework bundle (config/override/) and the pipeline bundle (pipeline_configs/).

Core changes:
- src/logger.py: new module — create_default_logger, load/merge logger.json,
  resolve_logger, CompositeLogger (custom primary + stdout mirror), and the
  top-level resolve_pipeline_logger entry point
- src/config/default/logger.json: shipped default (enabled: false)
- src/dlt_pipeline_builder.py: wire resolve_pipeline_logger; call
  register_bundle_sys_paths() before logger init so src/local/libraries/
  modules are importable when the factory is loaded
- src/bundle_loader.py: make logger optional to break the init chicken-and-egg
- src/utility.py: convert debug print() calls to logger.debug(); add optional
  logger param to get_data_from_files_parallel
- tests/test_logger.py: unit tests for merge, resolve, and CompositeLogger
- docs/source/feature_logging.rst: full rewrite; includes custom logger contract
  and step-by-step structured JSON logger example
@rederik76 rederik76 requested a review from haillew as a code owner May 17, 2026 03:18
@rederik76 rederik76 linked an issue May 17, 2026 that may be closed by this pull request
1 task
@rederik76 rederik76 self-assigned this May 17, 2026
@rederik76 rederik76 changed the base branch from main to feature/init-hooks-extensions-layout May 17, 2026 04:48
@lp-ae

lp-ae commented May 18, 2026

Copy link
Copy Markdown
Contributor

Big fan of this @rederik76, thanks for your efforts!

Base automatically changed from feature/init-hooks-extensions-layout to main May 18, 2026 23:01
@rederik76 rederik76 merged commit 66851d8 into main May 19, 2026
@rederik76 rederik76 deleted the feature/pluggable-logger branch May 19, 2026 00:55
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]: Bring Your Own Logger

3 participants